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.
0658415df97836616bf9b807e844d0ee?d=identicon&s=25 Grumpy (Guest)
on 2007-01-15 23: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.
2f9a03aa0fcfe945229cb6126eda2cb2?d=identicon&s=25 Philip Hallstrom (Guest)
on 2007-01-15 23: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
0658415df97836616bf9b807e844d0ee?d=identicon&s=25 Grumpy (Guest)
on 2007-01-16 14:51
(Received via mailing list)
Philip Hallstrom 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.