Walter Lee Davis
2010-Sep-16 17:04 UTC
vestal_versions -- can I set it to ignore certain columns?
I''d like my published boolean to be excluded from the calculation as to whether a version is created or not. Can anyone suggest a way to do that? Thanks, Walter -- 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-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
E. Litwin
2010-Sep-16 21:09 UTC
Re: vestal_versions -- can I set it to ignore certain columns?
On Sep 16, 10:04 am, Walter Lee Davis <wa...-HQgmohHLjDZWk0Htik3J/w@public.gmane.org> wrote:> I''d like my published boolean to be excluded from the calculation as > to whether a version is created or not. Can anyone suggest a way to do > that? >Digging into the code a bit, it appears you can specify options to ignore certain columns. In lib / vestal_versions / creation.rb, # Returns an array of column names that should be included in the changes of created # versions. If <tt>vestal_versions_options[:only]</tt> is specified, only those columns # will be versioned. Otherwise, if <tt>vestal_versions_options[:except]</tt> is specified, # all columns will be versioned other than those specified. Without either option, the # default is to version all columns. At any rate, the four "automagic" timestamp columns # maintained by Rails are never versioned. def versioned_columns case when vestal_versions_options[:only] then self.class.column_names & vestal_versions_options[:only] when vestal_versions_options[:except] then self.class.column_names - vestal_versions_options[:except] else self.class.column_names end - %w(created_at created_on updated_at updated_on) end> Thanks, > > Walter-- 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-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com. For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
Walter Lee Davis
2010-Sep-16 21:31 UTC
Re: Re: vestal_versions -- can I set it to ignore certain columns?
Thanks, that''s really helpful, but I''m not sure how to pass this on to vestal_versions. I''ve tried all manner of arguments to the versioned command, is that not the right place to do this? class Page < ActiveRecord::Base versioned :options => {:except => :publish} (also tried just :except => ''publish'', bunch of variations on that theme...) I''m using version 0.8.0 if that makes any difference. Thanks in advance, Walter On Sep 16, 2010, at 5:09 PM, E. Litwin wrote:> On Sep 16, 10:04 am, Walter Lee Davis <wa...-HQgmohHLjDZWk0Htik3J/w@public.gmane.org> wrote: >> I''d like my published boolean to be excluded from the calculation as >> to whether a version is created or not. Can anyone suggest a way to >> do >> that? >> > > Digging into the code a bit, it appears you can specify options to > ignore certain columns. > > In lib / vestal_versions / creation.rb, > # Returns an array of column names that should be included in > the changes of created > # versions. If <tt>vestal_versions_options[:only]</tt> is > specified, only those columns > # will be versioned. Otherwise, if > <tt>vestal_versions_options[:except]</tt> is specified, > # all columns will be versioned other than those specified. > Without either option, the > # default is to version all columns. At any rate, the four > "automagic" timestamp columns > # maintained by Rails are never versioned. > def versioned_columns > case > when vestal_versions_options[:only] then > self.class.column_names & vestal_versions_options[:only] > when vestal_versions_options[:except] then > self.class.column_names - vestal_versions_options[:except] > else self.class.column_names > end - %w(created_at created_on updated_at updated_on) > end > >> Thanks, >> >> Walter > > -- > 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-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@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 > . >-- 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-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
Walter Lee Davis
2010-Sep-16 21:46 UTC
Re: Re: vestal_versions -- can I set it to ignore certain columns?
I''m looking through the versions on Github -- and it looks like the latest versions might have this, while my older version does not. Gem refuses to update me further than this point, probably because I''m stuck on Ruby 1.8.6 on this machine. Walter On Sep 16, 2010, at 5:31 PM, Walter Lee Davis wrote:> Thanks, that''s really helpful, but I''m not sure how to pass this on > to vestal_versions. I''ve tried all manner of arguments to the > versioned command, is that not the right place to do this? > > class Page < ActiveRecord::Base > versioned :options => {:except => :publish} > > (also tried just :except => ''publish'', bunch of variations on that > theme...) > > I''m using version 0.8.0 if that makes any difference. > > Thanks in advance, > > Walter > > On Sep 16, 2010, at 5:09 PM, E. Litwin wrote: > >> On Sep 16, 10:04 am, Walter Lee Davis <wa...-HQgmohHLjDZWk0Htik3J/w@public.gmane.org> wrote: >>> I''d like my published boolean to be excluded from the calculation as >>> to whether a version is created or not. Can anyone suggest a way >>> to do >>> that? >>> >> >> Digging into the code a bit, it appears you can specify options to >> ignore certain columns. >> >> In lib / vestal_versions / creation.rb, >> # Returns an array of column names that should be included in >> the changes of created >> # versions. If <tt>vestal_versions_options[:only]</tt> is >> specified, only those columns >> # will be versioned. Otherwise, if >> <tt>vestal_versions_options[:except]</tt> is specified, >> # all columns will be versioned other than those specified. >> Without either option, the >> # default is to version all columns. At any rate, the four >> "automagic" timestamp columns >> # maintained by Rails are never versioned. >> def versioned_columns >> case >> when vestal_versions_options[:only] then >> self.class.column_names & vestal_versions_options[:only] >> when vestal_versions_options[:except] then >> self.class.column_names - vestal_versions_options[:except] >> else self.class.column_names >> end - %w(created_at created_on updated_at updated_on) >> end >> >>> Thanks, >>> >>> Walter >> >> -- >> 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 >> . >> > > -- > 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-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@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 > . >-- 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-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
Walter Lee Davis
2010-Sep-16 21:55 UTC
Re: Re: vestal_versions -- can I set it to ignore certain columns?
This is crazy. The version jump from 1.0.1 to 1.0.2 includes a dependency on Ruby 1.8.7, which I don''t have. I did manage to update to 1.0.1, we''ll see if this works now... Walter On Sep 16, 2010, at 5:46 PM, Walter Lee Davis wrote:> I''m looking through the versions on Github -- and it looks like the > latest versions might have this, while my older version does not. > Gem refuses to update me further than this point, probably because > I''m stuck on Ruby 1.8.6 on this machine. > > Walter > > On Sep 16, 2010, at 5:31 PM, Walter Lee Davis wrote: > >> Thanks, that''s really helpful, but I''m not sure how to pass this on >> to vestal_versions. I''ve tried all manner of arguments to the >> versioned command, is that not the right place to do this? >> >> class Page < ActiveRecord::Base >> versioned :options => {:except => :publish} >> >> (also tried just :except => ''publish'', bunch of variations on that >> theme...) >> >> I''m using version 0.8.0 if that makes any difference. >> >> Thanks in advance, >> >> Walter >> >> On Sep 16, 2010, at 5:09 PM, E. Litwin wrote: >> >>> On Sep 16, 10:04 am, Walter Lee Davis <wa...-HQgmohHLjDZWk0Htik3J/w@public.gmane.org> wrote: >>>> I''d like my published boolean to be excluded from the calculation >>>> as >>>> to whether a version is created or not. Can anyone suggest a way >>>> to do >>>> that? >>>> >>> >>> Digging into the code a bit, it appears you can specify options to >>> ignore certain columns. >>> >>> In lib / vestal_versions / creation.rb, >>> # Returns an array of column names that should be included in >>> the changes of created >>> # versions. If <tt>vestal_versions_options[:only]</tt> is >>> specified, only those columns >>> # will be versioned. Otherwise, if >>> <tt>vestal_versions_options[:except]</tt> is specified, >>> # all columns will be versioned other than those specified. >>> Without either option, the >>> # default is to version all columns. At any rate, the four >>> "automagic" timestamp columns >>> # maintained by Rails are never versioned. >>> def versioned_columns >>> case >>> when vestal_versions_options[:only] then >>> self.class.column_names & vestal_versions_options[:only] >>> when vestal_versions_options[:except] then >>> self.class.column_names - vestal_versions_options[:except] >>> else self.class.column_names >>> end - %w(created_at created_on updated_at updated_on) >>> end >>> >>>> Thanks, >>>> >>>> Walter >>> >>> -- >>> 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 >>> . >>> >> >> -- >> 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 >> . >> > > -- > 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-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@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 > . >-- 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-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
Walter Lee Davis
2010-Sep-16 22:34 UTC
Re: Re: vestal_versions -- can I set it to ignore certain columns?
Finally figured it out. Updating the gem meant a significant change in the database, as well as a method I had been using becoming protected. After a bit of hacking and swearing, I have the desired result. Checking the Publish control no longer forces a new version. Thanks for your help! Walter On Sep 16, 2010, at 5:55 PM, Walter Lee Davis wrote:> This is crazy. The version jump from 1.0.1 to 1.0.2 includes a > dependency on Ruby 1.8.7, which I don''t have. I did manage to update > to 1.0.1, we''ll see if this works now... > > Walter > > On Sep 16, 2010, at 5:46 PM, Walter Lee Davis wrote: > >> I''m looking through the versions on Github -- and it looks like the >> latest versions might have this, while my older version does not. >> Gem refuses to update me further than this point, probably because >> I''m stuck on Ruby 1.8.6 on this machine. >> >> Walter >> >> On Sep 16, 2010, at 5:31 PM, Walter Lee Davis wrote: >> >>> Thanks, that''s really helpful, but I''m not sure how to pass this >>> on to vestal_versions. I''ve tried all manner of arguments to the >>> versioned command, is that not the right place to do this? >>> >>> class Page < ActiveRecord::Base >>> versioned :options => {:except => :publish} >>> >>> (also tried just :except => ''publish'', bunch of variations on that >>> theme...) >>> >>> I''m using version 0.8.0 if that makes any difference. >>> >>> Thanks in advance, >>> >>> Walter >>> >>> On Sep 16, 2010, at 5:09 PM, E. Litwin wrote: >>> >>>> On Sep 16, 10:04 am, Walter Lee Davis <wa...-HQgmohHLjDZWk0Htik3J/w@public.gmane.org> wrote: >>>>> I''d like my published boolean to be excluded from the >>>>> calculation as >>>>> to whether a version is created or not. Can anyone suggest a way >>>>> to do >>>>> that? >>>>> >>>> >>>> Digging into the code a bit, it appears you can specify options to >>>> ignore certain columns. >>>> >>>> In lib / vestal_versions / creation.rb, >>>> # Returns an array of column names that should be included in >>>> the changes of created >>>> # versions. If <tt>vestal_versions_options[:only]</tt> is >>>> specified, only those columns >>>> # will be versioned. Otherwise, if >>>> <tt>vestal_versions_options[:except]</tt> is specified, >>>> # all columns will be versioned other than those specified. >>>> Without either option, the >>>> # default is to version all columns. At any rate, the four >>>> "automagic" timestamp columns >>>> # maintained by Rails are never versioned. >>>> def versioned_columns >>>> case >>>> when vestal_versions_options[:only] then >>>> self.class.column_names & vestal_versions_options[:only] >>>> when vestal_versions_options[:except] then >>>> self.class.column_names - vestal_versions_options[:except] >>>> else self.class.column_names >>>> end - %w(created_at created_on updated_at updated_on) >>>> end >>>> >>>>> Thanks, >>>>> >>>>> Walter >>>> >>>> -- >>>> 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 >>>> . >>>> >>> >>> -- >>> 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 >>> . >>> >> >> -- >> 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 >> . >> > > -- > 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-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@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 > . >-- 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-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.