continue save after before_update observer

Hi all,

I have a before_update observer method. But after that method is
finished, it doesn't proceed to ActiveRecord's save method. What do I
need to write in my before_update observer method to make it proceed
to the ActiveRecord save method.

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

Thanks in advance for your help.

Kind regards,
Joshua

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 :slight_smile:

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...