Issue with callbacks and Rails 3 #194

magagnon opened this Issue Oct 7, 2010 · 2 comments


None yet
2 participants

magagnon commented Oct 7, 2010

Rails 3 introduced a new api for callbacks. Callbacks should use the :terminator option to change the default behavior (exiting the callback chain on true instead of false)

Instead of this:
run_callbacks(:persist) { |result, object| result == true }

We need to do this:
base.define_callbacks 'persist', :terminator => 'result == true'

The problem with the current version is that we never exit the callback chain when a session is created. It just keeps going and it always goes through the whole chain.

I fixed the callbacks.rb file in this patch:


tiegz commented Oct 14, 2011


I can't believe this hasn't been caught by now. Fundamental change of run_callbacks, so the persistence chain isn't halted currently if a "persist_by_x" method returns true.


tiegz commented Oct 17, 2011

Fyi, patched this myself w/tests and sent a pull request: #285

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment