mirror of
https://github.com/github/rails.git
synced 2026-02-12 23:25:00 -05:00
Performance: minor Column#text? and #number? speedups
This commit is contained in:
@@ -30,11 +30,11 @@ module ActiveRecord
|
||||
end
|
||||
|
||||
def text?
|
||||
[:string, :text].include? type
|
||||
type == :string || type == :text
|
||||
end
|
||||
|
||||
def number?
|
||||
[:float, :integer, :decimal].include? type
|
||||
type == :integer || type == :float || type == :decimal
|
||||
end
|
||||
|
||||
# Returns the Ruby class that corresponds to the abstract data type.
|
||||
|
||||
Reference in New Issue
Block a user