1
0
Fork 0
mirror of https://github.com/heartcombo/devise.git synced 2022-11-09 12:18:31 -05:00

Don't use config option for flashing_formats

This commit is contained in:
Kaworu 2013-11-01 22:25:15 +01:00
parent c87809a0f5
commit fe1fb1f7a2
4 changed files with 3 additions and 13 deletions

View file

@ -209,10 +209,6 @@ module Devise
mattr_accessor :navigational_formats mattr_accessor :navigational_formats
@@navigational_formats = ["*/*", :html] @@navigational_formats = ["*/*", :html]
# Which formats should display flash messages.
mattr_accessor :flashing_formats
@@flashing_formats = nil
# When set to true, signing out a user signs out all other scopes. # When set to true, signing out a user signs out all other scopes.
mattr_accessor :sign_out_all_scopes mattr_accessor :sign_out_all_scopes
@@sign_out_all_scopes = true @@sign_out_all_scopes = true

View file

@ -291,8 +291,10 @@ module Devise
Devise.navigational_formats.include?(request_format) Devise.navigational_formats.include?(request_format)
end end
# Check if flash messages should be emitted. Default is to do it on
# navigational formats
def is_flashing_format? def is_flashing_format?
(Devise.flashing_formats || Devise.navigational_formats).include?(request_format) is_navigational_format?
end end
private private

View file

@ -221,10 +221,6 @@ Devise.setup do |config|
# The "*/*" below is required to match Internet Explorer requests. # The "*/*" below is required to match Internet Explorer requests.
# config.navigational_formats = ['*/*', :html] # config.navigational_formats = ['*/*', :html]
# Lists the formats that should display flash messages. Inherits
# navigational_formats if falsy
# config.flashing_formats = nil
# The default HTTP method used to sign out a resource. Default is :delete. # The default HTTP method used to sign out a resource. Default is :delete.
config.sign_out_via = :delete config.sign_out_via = :delete

View file

@ -162,10 +162,6 @@ Devise.setup do |config|
# should add them to the navigational formats lists. Default is [:html] # should add them to the navigational formats lists. Default is [:html]
# config.navigational_formats = [:html, :iphone] # config.navigational_formats = [:html, :iphone]
# Lists the formats that should display flash messages. Inherits
# navigational_formats if falsy
# config.flashing_formats = nil
# The default HTTP method used to sign out a resource. Default is :get. # The default HTTP method used to sign out a resource. Default is :get.
# config.sign_out_via = :get # config.sign_out_via = :get