On Dec 27, 2010, at 7:38 AM, bingo bob wrote:
> Have started to look at vestal versions...appears that it might be
> just
> the ticket, thanks for the idea.
>
> To use it, I imagine I have to specify any attributes I wish to
> version
> in the migration file generated by the vestal versions generate
> script -
> that right ?
>
> Not sure it's what I want though - will it allow me to do stuff like
> App.versionnumber.attribute?
>
I've been using it for two different projects now. It's very smooth.
All you need to do is put the versioned command in your model, and
build your VV table with a rake task, migrate, and you're set. The
versions are saved in YAML format in one big text field in the VV
table, so there's no need to have custom VV tables based on your
model, it just works. Once you have set up VV, you can add it to
another model with no further changes by simply adding versioned to
that model.
If there is a difference in regular (table-backed) attributes from one
version of an object to another, then yes, getting a specific version
will give you the complete state of the object as of that version.
There's nothing extra you need to do in order to get that, it just
works.
But if you want to have related (has_many) attributes and get the
value of those as of a particular version of the parent, then you will
need to find another solution. There's no way to do that with VV as
far as I know.
I also had to do some hacking to Paperclip in order to have versioned
attached photos. It's very messy and monkey-like, but if you'd like to
see it, let me know.
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@googlegroups.com.
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.
No comments:
Post a Comment