class Article
has_many Comments
end
class Comments
belongs_to Article
end
# Logic for importing Comments and Ratings
a = Article.find_by_name(name)
a.comments = comments # comments list gets saved.
# I want to delay this
#
# some other logic
#
Article.transaction
# save Comments
# save Ratings
end
在上面的示例中,如何禁用自动保存评论集合?
答案 0 :(得分:0)
在保存文章之前,请不要保存将评论添加到文章中。