well im going to sleep now but ill check it out tomorrow On Sat, Sep 11, 2010 at 2:35 PM, nobosh <[email protected]> wrote:
> Also tried: > > rails g vestal_versions > Could not find generator vestal_versions > > Anyone out there able to get Vestal Versions working with Rails 3? > > On Sep 11, 11:30 am, nobosh <[email protected]> wrote: > > To install Vestal Versions, after adding the gem you have to run: > > "script/generate vestal_versions" not sure if that's a Rails 3 command > > so I tried: "rails generate vestal_versions" which gave "Could not > > find generator vestal_versions" > > > > I did check to make sure it was installed: > > $ bundle show vestal_versions > > /Users/me/Sites/cline/vestal_versions/ruby/1.8/gems/ > > vestal_versions-1.0.2 > > > > Any ideas on how to install Vestal Versions? thxs again! > > > > On Sep 11, 11:03 am, nobosh <[email protected]> wrote: > > > > > > > > > Vestal Versions looks pretty impressive, only challenge is it doesn't > > > seem to play nice with Rails 3. > > > > > "ActiveRecord::DangerousAttributeError: changes is defined by > > > ActiveRecord" It uses a field in the model called changes. Not sure if > > > there are plans to fix that or not. > > > > > On Sep 11, 10:40 am, radhames brito <[email protected]> wrote: > > > > > > see if this helpshttp://railscasts.com/episodes/177-model-versioning > > > > > > On Sat, Sep 11, 2010 at 1:36 PM, nobosh <[email protected]> wrote: > > > > > I want to add a revision record on every update to the book record. > > > > > > > Like how a wiki works. Every time the wiki is update it tracks a > > > > > revision: > > > > > > http://upload.wikimedia.org/wikipedia/commons/4/41/Mediawiki-database... > > > > > > > On Sep 11, 10:34 am, radhames brito <[email protected]> wrote: > > > > > > you and to record every update or you overwrite when there is an > update? > > > > > > > > On Sat, Sep 11, 2010 at 1:13 PM, nobosh <[email protected]> > wrote: > > > > > > > Hello, newbie here... > > > > > > > > > I have the following models: > > > > > > > > > class Instance < ActiveRecord::Base > > > > > > > has_many :users > > > > > > > has_many :books > > > > > > > end > > > > > > > > > class User < ActiveRecord::Base > > > > > > > belongs_to :instance > > > > > > > end > > > > > > > > > class Book < ActiveRecord::Base > > > > > > > belongs_to :instance > > > > > > > end > > > > > > > > > I now want to add a BookRevision table, that has the following > columns > > > > > > > (id, user_id, version # (auto increment), diff (old book copy), > > > > > > > timestamps) > > > > > > > > > Logic: > > > > > > > 1. When a book is Created, a record is added to the > BookRevision > > > > > > > table, so we know who created the book in the first place > > > > > > > 2. When a book is Updated, a record is added with the user_id > (could > > > > > > > be a different user), and a new version #, and the old book > text, to > > > > > > > serve as an archive. > > > > > > > > > Given that I have the Instance, User, Book table implement in > my rails > > > > > > > add, are these the correct steps to make the above come to > life? > > > > > > > 1. Add a migration for the BookRevision table.... > > > > > > > rails generate migration AddTableBookRevision > user_id:integer > > > > > > > version:integer diff:text > > > > > > > 2. Then update the models as follows: > > > > > > > > > class Instance < ActiveRecord::Base > > > > > > > has_many :users > > > > > > > has_many :books > > > > > > > end > > > > > > > > > class User < ActiveRecord::Base > > > > > > > belongs_to :instance > > > > > > > end > > > > > > > > > class Book < ActiveRecord::Base > > > > > > > belongs_to :instance > > > > > > > has_many :BookRevisions > > > > > > > end > > > > > > > > > class BookRevision < ActiveRecord::Base > > > > > > > belongs_to :Book > > > > > > > end > > > > > > > > > Then in my controller, when adding a new book? Right now I > have: > > > > > > > @book = Book.create(params[:book].merge(:instance_id => > > > > > > > current_user.instance_id)) > > > > > > > How do I update that to account for the BookRevision > association? > > > > > > > > > Thanks for helping me out! > > > > > > > > > -- > > > > > > > You received this message because you are subscribed to the > Google > > > > > Groups > > > > > > > "Ruby on Rails: Talk" group. > > > > > > > To post to this group, send email to > [email protected] > > > > > . > > > > > > > To unsubscribe from this group, send email to > > > > > > > [email protected]<rubyonrails-talk%[email protected]><rubyonrails-talk%2Bunsubscrib > [email protected]><rubyonrails-talk%2Bunsubscrib > > > > > [email protected]> > > > > > > > . > > > > > > > For more options, visit this group at > > > > > > >http://groups.google.com/group/rubyonrails-talk?hl=en. > > > > > > > -- > > > > > You received this message because you are subscribed to the Google > Groups > > > > > "Ruby on Rails: Talk" group. > > > > > To post to this group, send email to > [email protected]. > > > > > To unsubscribe from this group, send email to > > > > > [email protected]<rubyonrails-talk%[email protected]><rubyonrails-talk%2Bunsubscrib > [email protected]> > > > > > . > > > > > For more options, visit this group at > > > > >http://groups.google.com/group/rubyonrails-talk?hl=en. > > -- > You received this message because you are subscribed to the Google Groups > "Ruby on Rails: Talk" group. > To post to this group, send email to [email protected]. > To unsubscribe from this group, send email to > [email protected]<rubyonrails-talk%[email protected]> > . > For more options, visit this group at > http://groups.google.com/group/rubyonrails-talk?hl=en. > > -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to [email protected]. To unsubscribe from this group, send email to [email protected]. For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.

