Ben,
You need to register your observers.I use the following snippet in my
apps ( in environment or shared lib required on startup ) :
ActiveRecord::Base.observers = Dir.chdir( File.join( RAILS_ROOT,
''app'', ''observers'' ) ) {
Dir.glob("**/
*.rb").collect{|o|
o.gsub!(''.rb'','''').split(''/'').last.to_sym
}
- Lourens
On 2007/05/04, at 22:37, Ben Johnson wrote:
>
> I have this:
>
> class UserObserver < ActiveRecord::Observer
> def before_save(user)
> raise "wtf"
> end
> end
>
>
> I resarted my web server (mongrel) and everything. When I save a user
> object I don''t get an error at all, it works fine. Any ideas why
> this is
> not working?
>
> Thanks for your help.
>
> --
> Posted via http://www.ruby-forum.com/.
>
>
--~--~---------~--~----~------------~-------~--~----~
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
rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
To unsubscribe from this group, send email to
rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
For more options, visit this group at
http://groups.google.com/group/rubyonrails-talk?hl=en
-~----------~----~----~----~------~----~------~--~---