Last active
August 29, 2015 14:01
-
-
Save otaviomedeiros/4f604a39c9f5bf0e50f6 to your computer and use it in GitHub Desktop.
Workaround for devise sign in when using flash responder
This file contains 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
# initializer to use when config.responders.flash_keys = [ :success, :error ] | |
module Responders | |
module FlashResponder | |
alias_method :original_set_flash_message?, :set_flash_message? | |
private | |
def set_flash_message? | |
original_set_flash_message? && !new_devise_session? | |
end | |
def new_devise_session? | |
request[:controller].eql?("devise/sessions") && request[:action].eql?("create") | |
end | |
end | |
end | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment