Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

Issue with callbacks and Rails 3 #194

Open
magagnon opened this Issue · 2 comments

2 participants

@magagnon

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

@tiegz
Collaborator

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

@tiegz
Collaborator

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
Something went wrong with that request. Please try again.