From 13e00ce6064fd1ce143071e3531e65f64047b013 Mon Sep 17 00:00:00 2001 From: Santiago Pastorino Date: Fri, 9 Apr 2010 15:56:50 -0300 Subject: fix stack trace lines on class_eval MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: José Valim --- activemodel/lib/active_model/attribute_methods.rb | 4 ++-- activemodel/lib/active_model/callbacks.rb | 6 +++--- 2 files changed, 5 insertions(+), 5 deletions(-) (limited to 'activemodel/lib') diff --git a/activemodel/lib/active_model/attribute_methods.rb b/activemodel/lib/active_model/attribute_methods.rb index f04829ef09..b7c368ad8d 100644 --- a/activemodel/lib/active_model/attribute_methods.rb +++ b/activemodel/lib/active_model/attribute_methods.rb @@ -221,7 +221,7 @@ module ActiveModel def alias_attribute(new_name, old_name) attribute_method_matchers.each do |matcher| - module_eval <<-STR, __FILE__, __LINE__+1 + module_eval <<-STR, __FILE__, __LINE__ + 1 def #{matcher.method_name(new_name)}(*args) send(:#{matcher.method_name(old_name)}, *args) end @@ -265,7 +265,7 @@ module ActiveModel else method_name = matcher.method_name(attr_name) - generated_attribute_methods.module_eval <<-STR, __FILE__, __LINE__+1 + generated_attribute_methods.module_eval <<-STR, __FILE__, __LINE__ + 1 if method_defined?(:#{method_name}) undef :#{method_name} end diff --git a/activemodel/lib/active_model/callbacks.rb b/activemodel/lib/active_model/callbacks.rb index d4e98de57b..ad12600d7c 100644 --- a/activemodel/lib/active_model/callbacks.rb +++ b/activemodel/lib/active_model/callbacks.rb @@ -105,7 +105,7 @@ module ActiveModel end def _define_before_model_callback(klass, callback) #:nodoc: - klass.class_eval <<-CALLBACK, __FILE__, __LINE__ + klass.class_eval <<-CALLBACK, __FILE__, __LINE__ + 1 def self.before_#{callback}(*args, &block) set_callback(:#{callback}, :before, *args, &block) end @@ -113,7 +113,7 @@ module ActiveModel end def _define_around_model_callback(klass, callback) #:nodoc: - klass.class_eval <<-CALLBACK, __FILE__, __LINE__ + klass.class_eval <<-CALLBACK, __FILE__, __LINE__ + 1 def self.around_#{callback}(*args, &block) set_callback(:#{callback}, :around, *args, &block) end @@ -121,7 +121,7 @@ module ActiveModel end def _define_after_model_callback(klass, callback) #:nodoc: - klass.class_eval <<-CALLBACK, __FILE__, __LINE__ + klass.class_eval <<-CALLBACK, __FILE__, __LINE__ + 1 def self.after_#{callback}(*args, &block) options = args.extract_options! options[:prepend] = true -- cgit v1.2.3