diff options
author | Jeremy Kemper <jeremy@bitsweat.net> | 2008-06-25 00:42:38 -0700 |
---|---|---|
committer | Jeremy Kemper <jeremy@bitsweat.net> | 2008-06-25 18:55:55 -0700 |
commit | c39726057714970f8e39d27bd0cb49fa4d6bc383 (patch) | |
tree | c4dd05f3f6451bd316d7657c96d17179d5eabd43 /activerecord | |
parent | 339491a6b37722497ebafe9998e17507f47e8fd6 (diff) | |
download | rails-c39726057714970f8e39d27bd0cb49fa4d6bc383.tar.gz rails-c39726057714970f8e39d27bd0cb49fa4d6bc383.tar.bz2 rails-c39726057714970f8e39d27bd0cb49fa4d6bc383.zip |
Performance: minor Column#text? and #number? speedups
Diffstat (limited to 'activerecord')
-rw-r--r-- | activerecord/lib/active_record/connection_adapters/abstract/schema_definitions.rb | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/activerecord/lib/active_record/connection_adapters/abstract/schema_definitions.rb b/activerecord/lib/active_record/connection_adapters/abstract/schema_definitions.rb index f968b9b173..02e444d4e8 100644 --- a/activerecord/lib/active_record/connection_adapters/abstract/schema_definitions.rb +++ b/activerecord/lib/active_record/connection_adapters/abstract/schema_definitions.rb @@ -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. |