提交 082326de 编写于 作者: S Santiago Pastorino

module_eval is not needed here

上级 6f4d9989
......@@ -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
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册