我正在使用refile
并有两个模型:
class UserApplication < ActiveRecord::Base
attachment :avatar
end
class User < ActiveRecord::Base
attachment :avatar
def from_application(application)
# ...
self.avatar = application.avatar
# ...
end
end
当我尝试设置User
from时,已关联UserApplication
的附件未与 a 一起保存。avatar
UserApplication
User
如何复制或附加UserApplication#avatar
到User
实例?