Displaying 2 results from an estimated 2 matches for "itemobserv".
Did you mean:
itemobserver
2006 Feb 22
0
How to get model observer to work?
I can''t seem to get a model observer to work. In my environment.rb I
have:
config.active_record.observers = :item_observer
In item_observer.rb I have:
class ItemObserver < ActiveRecord::Observer
observe Item
def after_update(item)
if @old.active != item.active
logger.debug ''observer#after_update''
#...
end
@old = nil
end
def before_update(item)
logger.debug ''observer#before_update''
@...
2006 Jan 30
1
What is .Instance?
With observers, you have to do (according to AWDWR):
ItemObserver.Instance
What is ''.Instance''? I''ve looked in both the Rails and Ruby docs and
don''t see any mention. I presume it''s like ''new''?
thanks
csn
--
Posted via http://www.ruby-forum.com/.