aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord
diff options
context:
space:
mode:
authorAaron Patterson <aaron.patterson@gmail.com>2013-10-24 14:37:56 -0700
committerAaron Patterson <aaron.patterson@gmail.com>2013-10-24 14:37:56 -0700
commit6ae3a4e535cd73135cecb8c13375f131fe4ff6f5 (patch)
treee7a60b006d63d1f5ddd2da15c99d41bc52914987 /activerecord
parent8f6e6e3e59be5dbe280b5a2b2a9b7fe1f6373f61 (diff)
parent252539c0366f3c3c222b809444d68f06383ca8ea (diff)
downloadrails-6ae3a4e535cd73135cecb8c13375f131fe4ff6f5.tar.gz
rails-6ae3a4e535cd73135cecb8c13375f131fe4ff6f5.tar.bz2
rails-6ae3a4e535cd73135cecb8c13375f131fe4ff6f5.zip
Merge pull request #12632 from al2o3cr/fix_race_for_attribute_methods
Always check to see if methods exist after calling define_attribute_methods
Diffstat (limited to 'activerecord')
-rw-r--r--activerecord/lib/active_record/attribute_methods.rb9
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