Displaying 1 result from an estimated 1 matches for "deliver_item_approv".
Did you mean:
deliver_item_approved
2006 Feb 28
0
Rolled my own alternative to trigger function with OLD/NEW
....
I came up with this alternative in Rails:
class Item < ActiveRecord::Base
def active=(value)
self.set_old(''active'', self.active)
write_attribute(:active, value)
end
def after_update
if !get_old(''active'') and self.active
Notifier::deliver_item_approved(self)
end
if get_old(''active'') != self.active
Maintenance.delete_cache(''...'') # I wrote my own alternative to
expire_fragment that actually works in models. Grumble...
end
end
protected
def get_old(value)
@old[value] unless @old....