From fc632dbb6efb1ea345a24bfc6e79f80697e4531a Mon Sep 17 00:00:00 2001 From: Michael Guterl Date: Thu, 25 Feb 2010 10:59:19 -0500 Subject: [PATCH] add positional information to all instances of eval --- lib/attribute_mapper.rb | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/lib/attribute_mapper.rb b/lib/attribute_mapper.rb index b8193e2..b544004 100644 --- a/lib/attribute_mapper.rb +++ b/lib/attribute_mapper.rb @@ -51,7 +51,7 @@ def map_attribute(attribute, options) private def add_accessor_for(attribute, mapping) - class_eval(<<-EVAL) + class_eval(<<-EVAL, __FILE__, __LINE__) class << self def #{attribute.to_s.pluralize} #{mapping.inspect} @@ -62,7 +62,7 @@ def #{attribute.to_s.pluralize} def add_predicates_for(attribute, names) names.each do |name| - class_eval(<<-RUBY) + class_eval(<<-RUBY, __FILE__, __LINE__) def #{name}? self.#{attribute} == :#{name} end @@ -89,7 +89,7 @@ def override(*args) end def override_getters(attribute) - class_eval(<<-EVAL) + class_eval(<<-EVAL, __FILE__, __LINE__) def #{attribute} self.class.#{attribute.to_s.pluralize}.invert[read_attribute(:#{attribute})] end @@ -97,7 +97,7 @@ def #{attribute} end def override_setters(attribute) - class_eval(<<-EVAL) + class_eval(<<-EVAL, __FILE__, __LINE__) def #{attribute}=(raw_value) value = resolve_value_of :#{attribute}, raw_value write_attribute(:#{attribute}, value)