1

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

class Page < ActiveRecord::Base

  versioned
end
krunal shah
  • 16,089
  • 25
  • 97
  • 143
  • I havent used it myelf but looking at vestal version github page it looks like it should do it automatically every time you update some data. And the code in your question, how is this even related with user_id, user_name and user_type? You have to explain your problem little more. – hs2d Apr 25 '11 at 12:05
  • @hs2d vestal_versions creates versions table. versions table contain user_id,user_name and user_type. I have a Page model which I am using with vestal_versions. I don't know how may I create entry for user_id,user_type inside versions. – krunal shah Apr 25 '11 at 12:14

1 Answers1

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)
mark
  • 10,316
  • 6
  • 37
  • 58