On Wed, Mar 31, 2010 at 4:21 AM, Joshua Partogi
<jpartogi-YxiBlgEkUCTQT0dZR+AlfA@public.gmane.org> wrote:
> This is what I wrote but it caused stack level too deep error:
>
> class FeatureObserver < ActiveRecord::Observer
> def before_update(feature)
> feature.send(:save)
> end
> end
:save precedes :update, so you''ve just created an infinite loop :-)
Try creating before_save, after_save, after_update methods in your
observer with some `puts` logging statements, and run in a console,
e.g.>> feature.send(:update)
>> feature.send(:save)
and see what you get...
--
Hassan Schroeder ------------------------
hassan.schroeder-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org
twitter: @hassan
--
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-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org
To unsubscribe from this group, send email to
rubyonrails-talk+unsubscribe@googlegroups.com.
For more options, visit this group at
http://groups.google.com/group/rubyonrails-talk?hl=en.