aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/lib/active_record/aggregations.rb
diff options
context:
space:
mode:
Diffstat (limited to 'activerecord/lib/active_record/aggregations.rb')
-rw-r--r--activerecord/lib/active_record/aggregations.rb10
1 files changed, 5 insertions, 5 deletions
diff --git a/activerecord/lib/active_record/aggregations.rb b/activerecord/lib/active_record/aggregations.rb
index 5be629e3d5..8c3cdc3c11 100644
--- a/activerecord/lib/active_record/aggregations.rb
+++ b/activerecord/lib/active_record/aggregations.rb
@@ -153,7 +153,7 @@ module ActiveRecord
"true"
end
- module_eval <<-end_eval
+ module_eval <<-end_eval, __FILE__, __LINE__
def #{name}(force_reload = false)
if (@#{name}.nil? || force_reload) && #{allow_nil_condition}
@#{name} = #{class_name}.new(#{mapping.collect { |pair| "read_attribute(\"#{pair.first}\")"}.join(", ")})
@@ -161,13 +161,13 @@ module ActiveRecord
return @#{name}
end
end_eval
- end
-
+ end
+
def writer_method(name, class_name, mapping, allow_nil)
mapping = (Array === mapping.first ? mapping : [ mapping ])
if allow_nil
- module_eval <<-end_eval
+ module_eval <<-end_eval, __FILE__, __LINE__
def #{name}=(part)
if part.nil?
#{mapping.collect { |pair| "@attributes[\"#{pair.first}\"] = nil" }.join("\n")}
@@ -178,7 +178,7 @@ module ActiveRecord
end
end_eval
else
- module_eval <<-end_eval
+ module_eval <<-end_eval, __FILE__, __LINE__
def #{name}=(part)
@#{name} = part.freeze
#{mapping.collect{ |pair| "@attributes[\"#{pair.first}\"] = part.#{pair.last}" }.join("\n")}