check out acts_as_modified plugin
http://svn.viney.net.nz/things/rails/plugins/acts_as_modified/
Chris
On 11/5/06, yeah <gnuemac-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
wrote:>
> Hi everybody,
>
> the other day, I thought it may be useful to have a .sync() method on
> ActiveRecord objects. The behavior would be something between a
> .reload() and a .save().
>
> - At every reload, an internal hash would store the attributes as they
> were in the db at reload time (think svn''s working-base)
> - whenever attributes are changed on the object, the values of that
> hash would remain untouched
> - whenever sync is called, the tuple gets reloaded from the db and both
> the current db tuple and the current object attribute values are
> compared to the working-base hash. if changes were made on the object,
> they get populated to the db and vice versa.
> - conflicts could result in exceptions or there could be defaults like
> so:
> my_object.sync :on_conflict_follow => :database
>
> I didn''t have time to implement this so far, but I wanted to share
this
> idea and get feedback. What do you think?
>
> Bests
>
> Jan
>
>
> >
>
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---