Issue with callbacks and Rails 3 #194

Open
magagnon opened this Issue Oct 7, 2010 · 2 comments

Comments

Projects
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:
http://github.com/magagnon/authlogic/commit/9280227b0983fec711d87b55b3cd7d33bf8114e5

Collaborator

tiegz commented Oct 14, 2011

+1

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.

Collaborator

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