标签: ruby-on-rails-3 after-save
我不知道这是否可行所以我想我会问。
1. Give a model some virtual attributes 2. Assign values to the model and the virtual attributes 3. Save the model 4. Use a callback after_save to create a different object with the virtual attributes.
可以在Rails 3中完成吗?
答案 0 :(得分:1)
只要关联与您无关,请使用:
http://apidock.com/rails/ActiveRecord/Base/clone