Forum: Ruby on Rails Create a log of changes to an attribute

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
Grumpy (Guest)
on 2007-01-16 00:36
(Received via mailing list)
Hi There,

I've got an Opportunity model that includes an order_value attribute.
I'd like any changes to an opportunity's order_value to be be reflected
as a new timestamped record in an order_value_entries table that
references opportunity_id.

I thought an Observer might be the right approach, but I'm not having
luck with the sytax.

Did I mention I'm just getting started in Rails?

Thanks in advance.
Philip H. (Guest)
on 2007-01-16 00:46
(Received via mailing list)
> I've got an Opportunity model that includes an order_value attribute.
> I'd like any changes to an opportunity's order_value to be be reflected
> as a new timestamped record in an order_value_entries table that
> references opportunity_id.

Never used it, but sounds like the acts_as_versioned pluging might be
what
you're looking for...

http://www.agilewebdevelopment.com/plugins/acts_as_versioned
Grumpy (Guest)
on 2007-01-16 15:51
(Received via mailing list)
Philip H. wrote:
> > I've got an Opportunity model that includes an order_value attribute.
> > I'd like any changes to an opportunity's order_value to be be reflected
> > as a new timestamped record in an order_value_entries table that
> > references opportunity_id.
>
> Never used it, but sounds like the acts_as_versioned pluging might be what
> you're looking for...
>
> http://www.agilewebdevelopment.com/plugins/acts_as_versioned

Thanks Philip - I'll take a look and let you know how it works.
This topic is locked and can not be replied to.