On 28 Sep 2008, at 13:30, Vahagn Hayrapetyan wrote:

>
>
> The problem is that the user.recently_reset? in the Observer returns
> nil.
>
> When I test def recently_reset? interactively in the console (testing
> the User model), it works as intended. So the user model works  
> correctly
> and the Observer does, too (as evidenced by the debugger and the first
> puts statement).
>
Well you set @reset to true after you've called save: at this point  
all the callbacks and observers and so on have already run so it's too  
late. You need to play with @reset before you call save.

Fred

> I tried to test the UserObserver interactively but get this:
>
>>> obs = UserObserver.new
> NoMethodError: private method `new' called for UserObserver:Class
>  from (irb):1
>>>
>
> Why does the Observer fail to read the user.recently_reset? correctly?
>
> Thanks a lot,
> Vahagn
> -- 
> 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 [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