aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorOscar Del Ben <info@oscardelben.com>2012-04-04 14:52:44 +0200
committerOscar Del Ben <info@oscardelben.com>2012-04-04 14:52:44 +0200
commite6cfd76219f699539f1f083287d9e06afdaaa9d6 (patch)
tree92abe9a0c7d6fbf8f97e9eb173abb93c5893da4e
parente25eeed5b873f05f9614ecf6720c0eb636d52b63 (diff)
downloadrails-e6cfd76219f699539f1f083287d9e06afdaaa9d6.tar.gz
rails-e6cfd76219f699539f1f083287d9e06afdaaa9d6.tar.bz2
rails-e6cfd76219f699539f1f083287d9e06afdaaa9d6.zip
Add better errors reporting for ActiveModel::Configuration
-rw-r--r--activemodel/lib/active_model/configuration.rb6
1 files changed, 3 insertions, 3 deletions
diff --git a/activemodel/lib/active_model/configuration.rb b/activemodel/lib/active_model/configuration.rb
index 1757c12ebf..ba5a6a2075 100644
--- a/activemodel/lib/active_model/configuration.rb
+++ b/activemodel/lib/active_model/configuration.rb
@@ -95,7 +95,7 @@ module ActiveModel
end
def define
- host.singleton_class.class_eval <<-CODE, __FILE__, __LINE__
+ host.singleton_class.class_eval <<-CODE, __FILE__, __LINE__ + 1
attr_accessor :#{name}
def #{name}?; !!#{name}; end
CODE
@@ -107,7 +107,7 @@ module ActiveModel
define_method("#{name}?") { !!send(name) }
end
- host.class_eval <<-CODE
+ host.class_eval <<-CODE, __FILE__, __LINE__ + 1
def #{name}; defined?(@#{name}) ? @#{name} : self.class.#{name}; end
def #{name}?; !!#{name}; end
CODE
@@ -117,7 +117,7 @@ module ActiveModel
define_method("#{name}=") { |val| host.send("#{name}=", val) }
end
else
- class_methods.class_eval <<-CODE, __FILE__, __LINE__
+ class_methods.class_eval <<-CODE, __FILE__, __LINE__ + 1
def #{name}=(val)
singleton_class.class_eval do
remove_possible_method(:#{name})