[Rails] Re: Know what was updated

2009-05-28 Thread Philip Hallstrom
> That's a great point Philip. I'm actually trying to solve that very > problem in a project I'm working on. > > I want to be able to do exactly what lighthouseapp does when it logs > ticket updates. In that case, you have comments that people can make > on a ticket. But when someone updates th

[Rails] Re: Know what was updated

2009-05-28 Thread JL Smith
That's a great point Philip. I'm actually trying to solve that very problem in a project I'm working on. I want to be able to do exactly what lighthouseapp does when it logs ticket updates. In that case, you have comments that people can make on a ticket. But when someone updates the ticket, I

[Rails] Re: Know what was updated

2009-05-28 Thread Philip Hallstrom
On May 28, 2009, at 8:13 AM, JL Smith wrote: > > First, get familiar with model callbacks if you're not already because > you don't want to put this logic in the controller: You might... the problem with the callbacks is you don't get access to the user who did it (depending on how they've lo

[Rails] Re: Know what was updated

2009-05-28 Thread blueomega
y, i´ve already updated the item model with Callbacks, the controller code was becoming ugly http://api.rubyonrails.org/classes/ActiveRecord/Dirty.html seems to do the job http://railscasts.com/episodes/109-tracking-attribute-changes seems also a good explanation, but i cant listen here, in a li

[Rails] Re: Know what was updated

2009-05-28 Thread JL Smith
First, get familiar with model callbacks if you're not already because you don't want to put this logic in the controller: http://guides.rails.info/activerecord_validations_callbacks.html#callbacks-overview Then check out the dirty object feature that ActiveRecord provides and how to use it: ht