我想覆盖 has_many 关联的构建方法。
class OtherThings < ActiveRecord::Base
belongs_to :my_model
end
class MyModel < ActiveRecord::Base
has_many :other_things
end
这样
m = MyModel.create
m.other_things.build # i'd like to add additional logic within the build method...
我已经更新了 OtherThings 的新方法,但这有点混乱。我希望我的逻辑只在关联时发生,因此构建......