Skip to content

Instantly share code, notes, and snippets.

@otaviomedeiros
Last active August 29, 2015 14:01
Show Gist options
  • Save otaviomedeiros/4f604a39c9f5bf0e50f6 to your computer and use it in GitHub Desktop.
Save otaviomedeiros/4f604a39c9f5bf0e50f6 to your computer and use it in GitHub Desktop.
Workaround for devise sign in when using flash responder
# 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