On Nov 12, 2010, at 2:23 PM, Walter Lee Davis wrote:

Ruby 1.8.7, Rails 2.3.10.

I have an Observer set to watch :roles and :ads. I've declared it in my environment.rb Within that, I have the following methods (just testing right now):

class ApproveObserver < ActiveRecord::Observer
 observe :role, :ad
 def after_create(record)
   Rails.logger.info( record.inspect )
 end
 def after_update(record)
   Rails.logger.info( record.inspect )
 end
 def before_destroy(record)
   Rails.logger.info( record.inspect )
 end
end

Both create and update are working fine, but destroy -- whether I try before or after -- doesn't fire off anything. Is that to do with the fact that I'm looking at a destroyed object after the fact, or is there something else going on here?



Dumb, dumb, dumb...

My controller was calling delete, not destroy. Changed that and all is well, it all works.

Walter


--
You received this message because you are subscribed to the Google Groups "Ruby on 
Rails: Talk" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en.

Reply via email to