diff options
author | bogdanvlviv <bogdanvlviv@gmail.com> | 2017-05-23 09:08:59 +0300 |
---|---|---|
committer | bogdanvlviv <bogdanvlviv@gmail.com> | 2017-05-29 21:37:45 +0300 |
commit | 37fd3d6afb8f7fa184df92e6ce89fa032480605a (patch) | |
tree | 6c6461bdd08caf8fc8b628c9a050f9e44d6e12ba | |
parent | 845aabbcd3805420090f8b92b50a4562577cf210 (diff) | |
download | rails-37fd3d6afb8f7fa184df92e6ce89fa032480605a.tar.gz rails-37fd3d6afb8f7fa184df92e6ce89fa032480605a.tar.bz2 rails-37fd3d6afb8f7fa184df92e6ce89fa032480605a.zip |
Pass params __FILE__ and __LINE__ + 1 if class_eval with <<
-rw-r--r-- | actionpack/lib/action_dispatch/journey/route.rb | 10 | ||||
-rw-r--r-- | actionview/lib/action_view/test_case.rb | 2 |
2 files changed, 6 insertions, 6 deletions
diff --git a/actionpack/lib/action_dispatch/journey/route.rb b/actionpack/lib/action_dispatch/journey/route.rb index 7bc15aa6b3..0acbac1d9d 100644 --- a/actionpack/lib/action_dispatch/journey/route.rb +++ b/actionpack/lib/action_dispatch/journey/route.rb @@ -10,11 +10,11 @@ module ActionDispatch module VerbMatchers VERBS = %w{ DELETE GET HEAD OPTIONS LINK PATCH POST PUT TRACE UNLINK } VERBS.each do |v| - class_eval <<-eoc - class #{v} - def self.verb; name.split("::").last; end - def self.call(req); req.#{v.downcase}?; end - end + class_eval <<-eoc, __FILE__, __LINE__ + 1 + class #{v} + def self.verb; name.split("::").last; end + def self.call(req); req.#{v.downcase}?; end + end eoc end diff --git a/actionview/lib/action_view/test_case.rb b/actionview/lib/action_view/test_case.rb index ae4fec4337..80403799ab 100644 --- a/actionview/lib/action_view/test_case.rb +++ b/actionview/lib/action_view/test_case.rb @@ -71,7 +71,7 @@ module ActionView def helper_method(*methods) # Almost a duplicate from ActionController::Helpers methods.flatten.each do |method| - _helpers.module_eval <<-end_eval + _helpers.module_eval <<-end_eval, __FILE__, __LINE__ + 1 def #{method}(*args, &block) # def current_user(*args, &block) _test_case.send(%(#{method}), *args, &block) # _test_case.send(%(current_user), *args, &block) end # end |