diff options
author | Sean Griffin <sean@thoughtbot.com> | 2014-06-16 14:55:01 -0600 |
---|---|---|
committer | Sean Griffin <sean@thoughtbot.com> | 2014-06-16 15:09:39 -0600 |
commit | 74af9f7fd781501e7f4a4746afd91b1bd5f77ddc (patch) | |
tree | 47c95a656a5b0aa0a8a6c72c1282832e13122004 /activerecord/test/cases/attribute_methods | |
parent | 88714deb677f598fa40f6e7b61a083a5461d07fd (diff) | |
download | rails-74af9f7fd781501e7f4a4746afd91b1bd5f77ddc.tar.gz rails-74af9f7fd781501e7f4a4746afd91b1bd5f77ddc.tar.bz2 rails-74af9f7fd781501e7f4a4746afd91b1bd5f77ddc.zip |
Promote time zone aware attributes to a first class type decorator
This refactoring revealed the need for another form of decoration, which
takes a proc to select which it applies to (There's a *lot* of cases
where this form can be used). To avoid duplication, we can re-implement
the old decoration in terms of the proc-based decoration.
The reason we're `instance_exec`ing the matcher is for cases such as
time zone aware attributes, where a decorator is defined in a parent
class, and a method called in the matcher is overridden by a child
class. The matcher will close over the parent, and evaluate in its
context, which is not the behavior we want.
Diffstat (limited to 'activerecord/test/cases/attribute_methods')
-rw-r--r-- | activerecord/test/cases/attribute_methods/read_test.rb | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/activerecord/test/cases/attribute_methods/read_test.rb b/activerecord/test/cases/attribute_methods/read_test.rb index c0659fddef..4741ee8799 100644 --- a/activerecord/test/cases/attribute_methods/read_test.rb +++ b/activerecord/test/cases/attribute_methods/read_test.rb @@ -12,6 +12,7 @@ module ActiveRecord @klass = Class.new do def self.superclass; Base; end def self.base_class; self; end + def self.decorate_matching_attribute_types(*); end include ActiveRecord::AttributeMethods |