diff options
| author | Matt Jones <al2o3cr@gmail.com> | 2013-10-24 15:06:53 -0400 |
|---|---|---|
| committer | Matt Jones <al2o3cr@gmail.com> | 2013-10-24 15:06:53 -0400 |
| commit | 252539c0366f3c3c222b809444d68f06383ca8ea (patch) | |
| tree | d57dd7b8f20bb18baeb35275af7df8a76e518816 | |
| parent | 3e5bb8693ac8583e32f7080db62fb23a280205cf (diff) | |
| download | rails-252539c0366f3c3c222b809444d68f06383ca8ea.tar.gz rails-252539c0366f3c3c222b809444d68f06383ca8ea.tar.bz2 rails-252539c0366f3c3c222b809444d68f06383ca8ea.zip | |
always check to see if methods exist after calling define_attribute_methods
| -rw-r--r-- | activerecord/lib/active_record/attribute_methods.rb | 9 |
1 files changed, 3 insertions, 6 deletions
diff --git a/activerecord/lib/active_record/attribute_methods.rb b/activerecord/lib/active_record/attribute_methods.rb index bf270c1829..43419efc75 100644 --- a/activerecord/lib/active_record/attribute_methods.rb +++ b/activerecord/lib/active_record/attribute_methods.rb @@ -161,12 +161,9 @@ module ActiveRecord # If we haven't generated any methods yet, generate them, then # see if we've created the method we're looking for. def method_missing(method, *args, &block) # :nodoc: - if self.class.define_attribute_methods - if respond_to_without_attributes?(method) - send(method, *args, &block) - else - super - end + self.class.define_attribute_methods + if respond_to_without_attributes?(method) + send(method, *args, &block) else super end |
