aboutsummaryrefslogtreecommitdiffstats
path: root/activemodel
diff options
context:
space:
mode:
authorSantiago Pastorino <santiago@wyeworks.com>2011-02-03 20:47:02 -0200
committerSantiago Pastorino <santiago@wyeworks.com>2011-02-03 20:47:02 -0200
commit082326deb5ba7e78d4a51ef6b8783d668066ed23 (patch)
tree2105dd2b7f85a62aa5d1070f9b866401ea987cf4 /activemodel
parent6f4d9989dd1b4d396aa8c37c9a9a7f240911d9b5 (diff)
downloadrails-082326deb5ba7e78d4a51ef6b8783d668066ed23.tar.gz
rails-082326deb5ba7e78d4a51ef6b8783d668066ed23.tar.bz2
rails-082326deb5ba7e78d4a51ef6b8783d668066ed23.zip
module_eval is not needed here
Diffstat (limited to 'activemodel')
-rw-r--r--activemodel/lib/active_model/attribute_methods.rb8
1 files changed, 3 insertions, 5 deletions
diff --git a/activemodel/lib/active_model/attribute_methods.rb b/activemodel/lib/active_model/attribute_methods.rb
index 9a89b0db9c..8f3782eb48 100644
--- a/activemodel/lib/active_model/attribute_methods.rb
+++ b/activemodel/lib/active_model/attribute_methods.rb
@@ -229,11 +229,9 @@ module ActiveModel
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