提交 ded3d97c 编写于 作者: J Joshua Peek

Make sure we use send for the default attribute method body because the suffix...

Make sure we use send for the default attribute method body because the suffix maybe an invalid method name
上级 1ae7eb52
......@@ -66,7 +66,7 @@ def define_attribute_methods
if respond_to?(generate_method)
send(generate_method, name)
else
evaluate_attribute_method("def #{method_name}(*args); attribute#{suffix}('#{name}', *args); end", method_name)
evaluate_attribute_method("def #{method_name}(*args); send(:attribute#{suffix}, '#{name}', *args); end", method_name)
end
end
end
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册