acts_as_versioned is a GREAT plugin. Having trouble only versioning specific fields however. Most of my fields will never change so it is a waste to store the same data over and over in all the versions. The docs say "the _versions table should contain all the fields you want versioned". I''ve done that -- the fields that I don''t want versioned are not in the _versions table. I get an error when I try to save though. Any ideas? Example: class Picture < ActiveRecord::Base belongs_to :style acts_as_versioned end @picture = Picture.find(1) @picture.caption = ''A new caption that should be in a new version.'' @picture.save Then I get: NoMethodError: undefined method `style_id='' for #<Picture::Version:0x3109e58> style_id will never change though (or I don''t care if its changes are versioned) so I did not include it in the picture_versions table. Thanks very much. -- Posted via http://www.ruby-forum.com/. --~--~---------~--~----~------------~-------~--~----~ 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 rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
On 1/23/07, Carl Johnson <rails-mailing-list-ARtvInVfO7ksV2N9l4h3zg@public.gmane.org> wrote:> > acts_as_versioned is a GREAT plugin. Having trouble only versioning > specific fields however. Most of my fields will never change so it is a > waste to store the same data over and over in all the versions. The docs > say "the _versions table should contain all the fields you want > versioned". I''ve done that -- the fields that I don''t want versioned are > not in the _versions table. I get an error when I try to save though. > Any ideas? > > Example: > > class Picture < ActiveRecord::Base > belongs_to :style > acts_as_versioned > end > > @picture = Picture.find(1) > @picture.caption = ''A new caption that should be in a new version.'' > @picture.save > > Then I get: NoMethodError: undefined method `style_id='' for > #<Picture::Version:0x3109e58> > > style_id will never change though (or I don''t care if its changes are > versioned) so I did not include it in the picture_versions table. > > Thanks very much.class Picture < AR::Base acts_as_versioned non_versioned_columns << ''style_id'' end -- Rick Olson http://weblog.techno-weenie.net http://mephistoblog.com --~--~---------~--~----~------------~-------~--~----~ 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 rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
> class Picture < AR::Base > acts_as_versioned > non_versioned_columns << ''style_id'' > endAhh, I see! I saw that referenced on the rails wiki but it was unclear. Thanks!! -- Posted via http://www.ruby-forum.com/. --~--~---------~--~----~------------~-------~--~----~ 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 rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
On 1/24/07, Carl Johnson <rails-mailing-list-ARtvInVfO7ksV2N9l4h3zg@public.gmane.org> wrote:> > > class Picture < AR::Base > > acts_as_versioned > > non_versioned_columns << ''style_id'' > > end > > Ahh, I see! I saw that referenced on the rails wiki but it was unclear. > Thanks!!in your rails app directory type: $ rake doc:plugins Then open doc/plugins/acts_as_versioned/index.html in your browser. -- Rick Olson http://weblog.techno-weenie.net http://mephistoblog.com --~--~---------~--~----~------------~-------~--~----~ 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 rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---