0

I am upgrading a rails3.0 app to rails3.1.10 I have model

class User < ActiveRecord::Base
belongs_to :account

.....

def some_method
  return unless self.account.updated?
  .......
end

end

but .updated? method seems to be removed from Rails3.1.10 Is there any alternatives to it? What I need is to track if parent object was changed

thanks

user1136228
  • 967
  • 9
  • 22

1 Answers1

1

I think you can use the method changed? which is a part of ActiveModel::Dirty.

EDIT:

If you want to track a record change after saving you can try the TrackIt gem which provides exactly the functionality you would like to have.

Erez Rabih
  • 15,562
  • 3
  • 47
  • 64