Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
如何将带有原始版本的 user_id、user_name、user_type 插入到版本表中?
class Page < ActiveRecord::Base versioned end
您需要在版本化模型中添加一个字段 :updated_by,然后插件将完成剩下的工作。例如,
@page.update_attributes(:body => "some cool content", :updated_by => current_user)