diff options
author | Aaron Patterson <aaron.patterson@gmail.com> | 2011-01-07 13:41:38 -0800 |
---|---|---|
committer | Aaron Patterson <aaron.patterson@gmail.com> | 2011-01-07 13:41:38 -0800 |
commit | f3d92f07565d1ec4b03fec7f3ba7c1c7d81e6073 (patch) | |
tree | 2be60d9c17dd349ed4d74a9fa8fa448ed040edb0 /activerecord | |
parent | 2ee4c8d90b6818867ad371907cb7d3c763318c3b (diff) | |
download | rails-f3d92f07565d1ec4b03fec7f3ba7c1c7d81e6073.tar.gz rails-f3d92f07565d1ec4b03fec7f3ba7c1c7d81e6073.tar.bz2 rails-f3d92f07565d1ec4b03fec7f3ba7c1c7d81e6073.zip |
method is never called with arguments
Diffstat (limited to 'activerecord')
-rw-r--r-- | activerecord/lib/active_record/aggregations.rb | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/activerecord/lib/active_record/aggregations.rb b/activerecord/lib/active_record/aggregations.rb index 8cd7389005..0224187fed 100644 --- a/activerecord/lib/active_record/aggregations.rb +++ b/activerecord/lib/active_record/aggregations.rb @@ -223,14 +223,12 @@ module ActiveRecord private def reader_method(name, class_name, mapping, allow_nil, constructor) module_eval do - define_method(name) do |*args| - force_reload = args.first || false - + define_method(name) do unless instance_variable_defined?("@#{name}") instance_variable_set("@#{name}", nil) end - if (instance_variable_get("@#{name}").nil? || force_reload) && (!allow_nil || mapping.any? {|pair| !read_attribute(pair.first).nil? }) + if (instance_variable_get("@#{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 |