Skip to content

Commit

Permalink
module_eval is not needed here
Browse files Browse the repository at this point in the history
  • Loading branch information
spastorino committed Feb 3, 2011
1 parent 6f4d998 commit 082326d
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions activemodel/lib/active_model/attribute_methods.rb
Original file line number Diff line number Diff line change
Expand Up @@ -229,11 +229,9 @@ def attribute_method_affix(*affixes)

def alias_attribute(new_name, old_name)
attribute_method_matchers.each do |matcher|
module_eval <<-STR, __FILE__, __LINE__ + 1
define_method('#{matcher.method_name(new_name)}') do |*args|
send('#{matcher.method_name(old_name)}', *args)
end
STR
define_method(matcher.method_name(new_name)) do |*args|
send(matcher.method_name(old_name), *args)
end
end
end

Expand Down

0 comments on commit 082326d

Please sign in to comment.