Created
August 17, 2011 18:19
-
-
Save tiegz/1152224 to your computer and use it in GitHub Desktop.
Prioritize order of Authlogic::Session::Base persistence callbacks for Rails 3
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class UserSession < Authlogic::Session::Base | |
... # rest of your code | |
_persist_callbacks.replace(_persist_callbacks.sort_by { |cb| | |
order = %w(params session http_auth cookie).index(cb.filter.to_s.sub(/^persist_by_/, '')) | |
order || _persist_callbacks.size | |
}) | |
__define_runner(:persist) # must regenerate _run_persist_callbacks() to take effect | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment