Skip to content
Browse files

Make sure evalled method knows where it came from

  • Loading branch information...
1 parent 981f696 commit cf4978313bbf908f85ff23c7a484bc856bed5181 Yehuda Katz committed
Showing with 2 additions and 2 deletions.
  1. +2 −2 actionpack/lib/action_dispatch/http/mime_type.rb
View
4 actionpack/lib/action_dispatch/http/mime_type.rb
@@ -10,8 +10,8 @@ def symbols
%w(<< concat shift unshift push pop []= clear compact! collect!
delete delete_at delete_if flatten! map! insert reject! reverse!
replace slice! sort! uniq!).each do |method|
- module_eval <<-CODE
- def #{method}(*args)
+ module_eval <<-CODE, __FILE__, __LINE__ + 1
+ def #{method}(*)
@symbols = nil
super
end

2 comments on commit cf49783

@fsvehla

Lovely! How about writing an example for the generated code right next to it in a comment?

@lifo
Ruby on Rails member

Comments for the generated code would just be noise, more so in this case!

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