From 288b56f550fb239352537b93f737cfd4b68ddb0f Mon Sep 17 00:00:00 2001 From: Xavier Noria Date: Thu, 25 Apr 2013 19:31:07 +0200 Subject: fixes warning in the AR test suite --- activerecord/lib/active_record/attribute_methods.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'activerecord/lib') diff --git a/activerecord/lib/active_record/attribute_methods.rb b/activerecord/lib/active_record/attribute_methods.rb index 7f59d0b4c6..818bb1a8a6 100644 --- a/activerecord/lib/active_record/attribute_methods.rb +++ b/activerecord/lib/active_record/attribute_methods.rb @@ -172,7 +172,7 @@ module ActiveRecord # If the result is true then check for the select case. # For queries selecting a subset of columns, return false for unselected columns. - if @attributes.present? && self.class.column_names.include?(name) + if defined?(@attributes) && @attributes.present? && self.class.column_names.include?(name) return has_attribute?(name) end -- cgit v1.2.3