Skip to content

Commit f3d92f0

Browse files
committed
method is never called with arguments
1 parent 2ee4c8d commit f3d92f0

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

activerecord/lib/active_record/aggregations.rb

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -223,14 +223,12 @@ def composed_of(part_id, options = {})
223223
private
224224
def reader_method(name, class_name, mapping, allow_nil, constructor)
225225
module_eval do
226-
define_method(name) do |*args|
227-
force_reload = args.first || false
228-
226+
define_method(name) do
229227
unless instance_variable_defined?("@#{name}")
230228
instance_variable_set("@#{name}", nil)
231229
end
232230

233-
if (instance_variable_get("@#{name}").nil? || force_reload) && (!allow_nil || mapping.any? {|pair| !read_attribute(pair.first).nil? })
231+
if (instance_variable_get("@#{name}").nil?) && (!allow_nil || mapping.any? {|pair| !read_attribute(pair.first).nil? })
234232
attrs = mapping.collect {|pair| read_attribute(pair.first)}
235233
object = case constructor
236234
when Symbol

0 commit comments

Comments
 (0)