Skip to content
Browse files

Merge pull request #5736 from oscardelben/configuration_errors_reporting

Add better errors reporting for ActiveModel::Configuration
  • Loading branch information...
2 parents 19ecde0 + e6cfd76 commit e177525d6f6d0f7cf781171ae1c0ef91df7eb4f9 @jonleighton jonleighton committed
Showing with 3 additions and 3 deletions.
  1. +3 −3 activemodel/lib/active_model/configuration.rb
View
6 activemodel/lib/active_model/configuration.rb
@@ -95,7 +95,7 @@ def class_methods
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 @@ def #{name}?; !!#{name}; end
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 @@ def #{name}?; !!#{name}; end
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})

0 comments on commit e177525

Please sign in to comment.
Something went wrong with that request. Please try again.