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 <[email protected]> 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-
[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
.
--
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.