how to insert user_id,user_name,user_type with vestal versions?

≯℡__Kan透↙ 提交于 2019-12-11 07:35:13

问题


how to insert user_id,user_name,user_type with vestal versions into the versions table ?

class Page < ActiveRecord::Base

  versioned
end

回答1:


You need to add a field to your versioned model, :updated_by, then the plugin will do the rest. So for example,

@page.update_attributes(:body => "some cool content", :updated_by => current_user)


来源:https://stackoverflow.com/questions/5778088/how-to-insert-user-id-user-name-user-type-with-vestal-versions

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!