1
0
Fork 0
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:
Jeremy Kemper 2008-06-25 00:42:38 -07:00
parent 339491a6b3
commit c397260577

View file

@ -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.