提交 8ea64bd0 编写于 作者: A Aaron Patterson

remove more mutations from the `build` method

上级 faf4a39c
...@@ -8,13 +8,8 @@ def valid_options ...@@ -8,13 +8,8 @@ def valid_options
super + [:join_table, :association_foreign_key] super + [:join_table, :association_foreign_key]
end end
def build def define_callbacks(model, reflection)
reflection = super super
define_destroy_hook
reflection
end
def define_destroy_hook
name = self.name name = self.name
model.send(:include, Module.new { model.send(:include, Module.new {
class_eval <<-RUBY, __FILE__, __LINE__ + 1 class_eval <<-RUBY, __FILE__, __LINE__ + 1
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册