Skip to content
This repository
Browse code

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...
commit 7d2c414c90d3d3209d58d1f87c45fbddb81d32b1 1 parent 30efdd6
Aaron Patterson authored October 24, 2013 rafaelfranca committed October 24, 2013
9  activerecord/lib/active_record/attribute_methods.rb
@@ -144,12 +144,9 @@ def attribute_names
144 144
     # If we haven't generated any methods yet, generate them, then
145 145
     # see if we've created the method we're looking for.
146 146
     def method_missing(method, *args, &block) # :nodoc:
147  
-      if self.class.define_attribute_methods
148  
-        if respond_to_without_attributes?(method)
149  
-          send(method, *args, &block)
150  
-        else
151  
-          super
152  
-        end
  147
+      self.class.define_attribute_methods
  148
+      if respond_to_without_attributes?(method)
  149
+        send(method, *args, &block)
153 150
       else
154 151
         super
155 152
       end

0 notes on commit 7d2c414

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