diff options
Diffstat (limited to 'activerecord/lib')
-rwxr-xr-x | activerecord/lib/active_record/base.rb | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/activerecord/lib/active_record/base.rb b/activerecord/lib/active_record/base.rb index 820e6a80ce..e90c65ee07 100755 --- a/activerecord/lib/active_record/base.rb +++ b/activerecord/lib/active_record/base.rb @@ -1763,7 +1763,8 @@ module ActiveRecord #:nodoc: method_name = method_id.to_s if @attributes.include?(method_name) or (md = /\?$/.match(method_name) and - @attributes.include?(method_name = md.pre_match)) + @attributes.include?(query_method_name = md.pre_match) and + method_name = query_method_name) define_read_methods if self.class.read_methods.empty? && self.class.generate_read_methods md ? query_attribute(method_name) : read_attribute(method_name) elsif self.class.primary_key.to_s == method_name |