From fe1fb1f7a2dd1e7b8ae2bb5b42afc53536b77e1f Mon Sep 17 00:00:00 2001 From: Kaworu Date: Fri, 1 Nov 2013 22:25:15 +0100 Subject: [PATCH] Don't use config option for flashing_formats --- lib/devise.rb | 4 ---- lib/devise/controllers/helpers.rb | 4 +++- lib/generators/templates/devise.rb | 4 ---- test/rails_app/config/initializers/devise.rb | 4 ---- 4 files changed, 3 insertions(+), 13 deletions(-) diff --git a/lib/devise.rb b/lib/devise.rb index 69b282fa..99e585df 100644 --- a/lib/devise.rb +++ b/lib/devise.rb @@ -209,10 +209,6 @@ module Devise mattr_accessor :navigational_formats @@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. mattr_accessor :sign_out_all_scopes @@sign_out_all_scopes = true diff --git a/lib/devise/controllers/helpers.rb b/lib/devise/controllers/helpers.rb index ab14551e..697f6a3c 100644 --- a/lib/devise/controllers/helpers.rb +++ b/lib/devise/controllers/helpers.rb @@ -291,8 +291,10 @@ module Devise Devise.navigational_formats.include?(request_format) end + # Check if flash messages should be emitted. Default is to do it on + # navigational formats def is_flashing_format? - (Devise.flashing_formats || Devise.navigational_formats).include?(request_format) + is_navigational_format? end private diff --git a/lib/generators/templates/devise.rb b/lib/generators/templates/devise.rb index 802cd3f4..ab0e8c0e 100644 --- a/lib/generators/templates/devise.rb +++ b/lib/generators/templates/devise.rb @@ -221,10 +221,6 @@ Devise.setup do |config| # The "*/*" below is required to match Internet Explorer requests. # 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. config.sign_out_via = :delete diff --git a/test/rails_app/config/initializers/devise.rb b/test/rails_app/config/initializers/devise.rb index 3682bb6b..84031881 100644 --- a/test/rails_app/config/initializers/devise.rb +++ b/test/rails_app/config/initializers/devise.rb @@ -162,10 +162,6 @@ Devise.setup do |config| # should add them to the navigational formats lists. Default is [:html] # 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. # config.sign_out_via = :get