Skip to content
Browse files

Merge pull request #12632 from al2o3cr/fix_race_for_attribute_methods

Always check to see if methods exist after calling define_attribute_methods
  • Loading branch information...
2 parents 8f6e6e3 + 252539c commit 6ae3a4e535cd73135cecb8c13375f131fe4ff6f5 @tenderlove tenderlove committed Oct 24, 2013
Showing with 3 additions and 6 deletions.
  1. +3 −6 activerecord/lib/active_record/attribute_methods.rb
View
9 activerecord/lib/active_record/attribute_methods.rb
@@ -161,12 +161,9 @@ def attribute_names
# 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

0 comments on commit 6ae3a4e

Please sign in to comment.
Something went wrong with that request. Please try again.