我正在使用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
设置UserApplication
时,与avatar
关联的UserApplication
附件未与User
一起保存。
如何将UserApplication#avatar
复制或附加到User
实例?