Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Merge pull request #5736 from oscardelben/configuration_errors_reporting

Add better errors reporting for ActiveModel::Configuration
  • Loading branch information...
commit e177525d6f6d0f7cf781171ae1c0ef91df7eb4f9 2 parents 19ecde0 + e6cfd76
@jonleighton jonleighton authored
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})
Please sign in to comment.
Something went wrong with that request. Please try again.