diff options
Diffstat (limited to 'activerecord')
-rw-r--r-- | activerecord/lib/active_record/aggregations.rb | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/activerecord/lib/active_record/aggregations.rb b/activerecord/lib/active_record/aggregations.rb index 4b1fa5c59c..44e595383e 100644 --- a/activerecord/lib/active_record/aggregations.rb +++ b/activerecord/lib/active_record/aggregations.rb @@ -222,7 +222,7 @@ module ActiveRecord def reader_method(name, class_name, mapping, allow_nil, constructor) module_eval do define_method(name) do - if (@aggregation_cache[name].nil?) && (!allow_nil || mapping.any? {|pair| !read_attribute(pair.first).nil? }) + if @aggregation_cache[name].nil? && (!allow_nil || mapping.any? {|pair| !read_attribute(pair.first).nil? }) attrs = mapping.collect {|pair| read_attribute(pair.first)} object = case constructor when Symbol |