diff options
author | Jon Leighton <j@jonathanleighton.com> | 2011-11-30 22:31:52 +0000 |
---|---|---|
committer | Jon Leighton <j@jonathanleighton.com> | 2011-11-30 23:18:40 +0000 |
commit | 7895182d0fce11131024305f53d0cbb32817e65c (patch) | |
tree | 5781756f8fdd6cabd552d32631433c656cc51cc9 /activerecord/test/cases | |
parent | 4f20eb5908895ac1f074cc1e2bc60f58e2d50a03 (diff) | |
download | rails-7895182d0fce11131024305f53d0cbb32817e65c.tar.gz rails-7895182d0fce11131024305f53d0cbb32817e65c.tar.bz2 rails-7895182d0fce11131024305f53d0cbb32817e65c.zip |
omg computer science!
Implement a mini state machine for serialized attributes. This means we
do not have to deserialize the values upon initialization, which means
that if we never actually access the attribute, we never have to
deserialize it.
Diffstat (limited to 'activerecord/test/cases')
-rw-r--r-- | activerecord/test/cases/attribute_methods_test.rb | 6 |
1 files changed, 1 insertions, 5 deletions
diff --git a/activerecord/test/cases/attribute_methods_test.rb b/activerecord/test/cases/attribute_methods_test.rb index 0327e5aea8..12e5715710 100644 --- a/activerecord/test/cases/attribute_methods_test.rb +++ b/activerecord/test/cases/attribute_methods_test.rb @@ -686,17 +686,13 @@ class AttributeMethodsTest < ActiveRecord::TestCase private def cached_columns - @cached_columns ||= (time_related_columns_on_topic + serialized_columns_on_topic).map(&:name) + @cached_columns ||= time_related_columns_on_topic.map(&:name) end def time_related_columns_on_topic Topic.columns.select { |c| c.type.in?([:time, :date, :datetime, :timestamp]) } end - def serialized_columns_on_topic - Topic.columns.select { |c| Topic.serialized_attributes.include?(c.name) } - end - def in_time_zone(zone) old_zone = Time.zone old_tz = ActiveRecord::Base.time_zone_aware_attributes |