aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/lib/active_record/aggregations.rb
diff options
context:
space:
mode:
authorAaron Patterson <aaron.patterson@gmail.com>2011-01-07 13:41:38 -0800
committerAaron Patterson <aaron.patterson@gmail.com>2011-01-07 13:41:38 -0800
commitf3d92f07565d1ec4b03fec7f3ba7c1c7d81e6073 (patch)
tree2be60d9c17dd349ed4d74a9fa8fa448ed040edb0 /activerecord/lib/active_record/aggregations.rb
parent2ee4c8d90b6818867ad371907cb7d3c763318c3b (diff)
downloadrails-f3d92f07565d1ec4b03fec7f3ba7c1c7d81e6073.tar.gz
rails-f3d92f07565d1ec4b03fec7f3ba7c1c7d81e6073.tar.bz2
rails-f3d92f07565d1ec4b03fec7f3ba7c1c7d81e6073.zip
method is never called with arguments
Diffstat (limited to 'activerecord/lib/active_record/aggregations.rb')
-rw-r--r--activerecord/lib/active_record/aggregations.rb6
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