diff options
author | Jon Leighton <j@jonathanleighton.com> | 2012-04-11 16:20:42 -0700 |
---|---|---|
committer | Jon Leighton <j@jonathanleighton.com> | 2012-04-11 16:20:42 -0700 |
commit | e177525d6f6d0f7cf781171ae1c0ef91df7eb4f9 (patch) | |
tree | c944475aa6de4230e3527924f9950acb42fc6e6c /activemodel/lib | |
parent | 19ecde00ff8a72c0c09685525c9d1eace79e8d75 (diff) | |
parent | e6cfd76219f699539f1f083287d9e06afdaaa9d6 (diff) | |
download | rails-e177525d6f6d0f7cf781171ae1c0ef91df7eb4f9.tar.gz rails-e177525d6f6d0f7cf781171ae1c0ef91df7eb4f9.tar.bz2 rails-e177525d6f6d0f7cf781171ae1c0ef91df7eb4f9.zip |
Merge pull request #5736 from oscardelben/configuration_errors_reporting
Add better errors reporting for ActiveModel::Configuration
Diffstat (limited to 'activemodel/lib')
-rw-r--r-- | activemodel/lib/active_model/configuration.rb | 6 |
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}) |