mirror of
https://github.com/rails/rails.git
synced 2022-11-09 12:12:34 -05:00
Performance: minor Column#text? and #number? speedups
This commit is contained in:
parent
339491a6b3
commit
c397260577
1 changed files with 2 additions and 2 deletions
|
@ -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.
|
||||
|
|
Loading…
Reference in a new issue