diff options
author | Sam <sam.saffron@gmail.com> | 2013-08-27 09:20:59 +1000 |
---|---|---|
committer | Sam <sam.saffron@gmail.com> | 2013-08-27 09:20:59 +1000 |
commit | 4ff87909a95354136c51f33b1402fca484da961b (patch) | |
tree | c6aeac6a7dca476b02f61f45904e69250baf45e5 | |
parent | 32b233c95315f637a944a1a8f41cb188a452e859 (diff) | |
download | rails-4ff87909a95354136c51f33b1402fca484da961b.tar.gz rails-4ff87909a95354136c51f33b1402fca484da961b.tar.bz2 rails-4ff87909a95354136c51f33b1402fca484da961b.zip |
Perf: avoid array allocation where not needed
-rw-r--r-- | activerecord/lib/active_record/attribute_methods/time_zone_conversion.rb | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/activerecord/lib/active_record/attribute_methods/time_zone_conversion.rb b/activerecord/lib/active_record/attribute_methods/time_zone_conversion.rb index 41b5a6e926..f168282ea3 100644 --- a/activerecord/lib/active_record/attribute_methods/time_zone_conversion.rb +++ b/activerecord/lib/active_record/attribute_methods/time_zone_conversion.rb @@ -51,7 +51,7 @@ module ActiveRecord def create_time_zone_conversion_attribute?(name, column) time_zone_aware_attributes && !self.skip_time_zone_conversion_for_attributes.include?(name.to_sym) && - [:datetime, :timestamp].include?(column.type) + (:datetime == column.type || :timestamp == column.type) end end end |