Browse files

module_eval is not needed here

  • Loading branch information...
1 parent 6f4d998 commit 082326deb5ba7e78d4a51ef6b8783d668066ed23 @spastorino spastorino committed Feb 3, 2011
Showing with 3 additions and 5 deletions.
  1. +3 −5 activemodel/lib/active_model/attribute_methods.rb
View
8 activemodel/lib/active_model/attribute_methods.rb
@@ -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

0 comments on commit 082326d

Please sign in to comment.