diff --git a/app/controllers/devise/registrations_controller.rb b/app/controllers/devise/registrations_controller.rb index 42b0f006..36dcd825 100644 --- a/app/controllers/devise/registrations_controller.rb +++ b/app/controllers/devise/registrations_controller.rb @@ -1,5 +1,5 @@ class Devise::RegistrationsController < DeviseController - prepend_before_filter :require_no_authentication, only: [ :new, :create, :cancel ] + prepend_before_filter :require_no_authentication, only: [:new, :create, :cancel] prepend_before_filter :authenticate_scope!, only: [:edit, :update, :destroy] # GET /resource/sign_up diff --git a/app/controllers/devise/sessions_controller.rb b/app/controllers/devise/sessions_controller.rb index d6a7a28a..d8d18d78 100644 --- a/app/controllers/devise/sessions_controller.rb +++ b/app/controllers/devise/sessions_controller.rb @@ -1,8 +1,8 @@ class Devise::SessionsController < DeviseController - prepend_before_filter :require_no_authentication, only: [ :new, :create ] + prepend_before_filter :require_no_authentication, only: [:new, :create] prepend_before_filter :allow_params_authentication!, only: :create prepend_before_filter :verify_signed_out_user, only: :destroy - prepend_before_filter only: [ :create, :destroy ] { request.env["devise.skip_timeout"] = true } + prepend_before_filter only: [:create, :destroy] { request.env["devise.skip_timeout"] = true } # GET /resource/sign_in def new diff --git a/lib/devise/controllers/sign_in_out.rb b/lib/devise/controllers/sign_in_out.rb index 8516d434..c8ab6ac7 100644 --- a/lib/devise/controllers/sign_in_out.rb +++ b/lib/devise/controllers/sign_in_out.rb @@ -6,7 +6,7 @@ module Devise # Return true if the given scope is signed in session. If no scope given, return # true if any scope is signed in. Does not run authentication hooks. def signed_in?(scope=nil) - [ scope || Devise.mappings.keys ].flatten.any? do |_scope| + [scope || Devise.mappings.keys].flatten.any? do |_scope| warden.authenticate?(scope: _scope) end end diff --git a/lib/devise/models/validatable.rb b/lib/devise/models/validatable.rb index bd21fbf6..3a080370 100644 --- a/lib/devise/models/validatable.rb +++ b/lib/devise/models/validatable.rb @@ -14,8 +14,8 @@ module Devise # module Validatable # All validations used by this module. - VALIDATIONS = [ :validates_presence_of, :validates_uniqueness_of, :validates_format_of, - :validates_confirmation_of, :validates_length_of ].freeze + VALIDATIONS = [:validates_presence_of, :validates_uniqueness_of, :validates_format_of, + :validates_confirmation_of, :validates_length_of].freeze def self.required_fields(klass) [] diff --git a/lib/devise/rails/routes.rb b/lib/devise/rails/routes.rb index 23991f3e..9f0cf581 100644 --- a/lib/devise/rails/routes.rb +++ b/lib/devise/rails/routes.rb @@ -119,7 +119,7 @@ module ActionDispatch::Routing # * sign_out_via: the HTTP method(s) accepted for the :sign_out action (default: :get), # if you wish to restrict this to accept only :post or :delete requests you should do: # - # devise_for :users, sign_out_via: [ :post, :delete ] + # devise_for :users, sign_out_via: [:post, :delete] # # You need to make sure that your sign_out controls trigger a request with a matching HTTP method. # diff --git a/lib/generators/templates/devise.rb b/lib/generators/templates/devise.rb index b9fc2502..020bfc34 100644 --- a/lib/generators/templates/devise.rb +++ b/lib/generators/templates/devise.rb @@ -35,7 +35,7 @@ Devise.setup do |config| # session. If you need permissions, you should implement that in a before filter. # You can also supply a hash where the value is a boolean determining whether # or not authentication should be aborted when the value is not present. - # config.authentication_keys = [ :email ] + # config.authentication_keys = [:email] # Configure parameters from the request object used for authentication. Each entry # given should be a request method and it will automatically be passed to the diff --git a/test/rails_app/config/application.rb b/test/rails_app/config/application.rb index 91c75cb9..351b7c6a 100644 --- a/test/rails_app/config/application.rb +++ b/test/rails_app/config/application.rb @@ -17,7 +17,7 @@ module RailsApp class Application < Rails::Application # Add additional load paths for your own custom dirs config.autoload_paths.reject!{ |p| p =~ /\/app\/(\w+)$/ && !%w(controllers helpers mailers views).include?($1) } - config.autoload_paths += [ "#{config.root}/app/#{DEVISE_ORM}" ] + config.autoload_paths += ["#{config.root}/app/#{DEVISE_ORM}"] # Configure generators values. Many other options are available, be sure to check the documentation. # config.generators do |g| diff --git a/test/rails_app/config/environments/production.rb b/test/rails_app/config/environments/production.rb index 01798716..6a13ede1 100644 --- a/test/rails_app/config/environments/production.rb +++ b/test/rails_app/config/environments/production.rb @@ -50,7 +50,7 @@ RailsApp::Application.configure do config.log_level = :info # Prepend all log lines with the following tags. - # config.log_tags = [ :subdomain, :uuid ] + # config.log_tags = [:subdomain, :uuid] # Use a different logger for distributed setups. # config.logger = ActiveSupport::TaggedLogging.new(SyslogLogger.new) diff --git a/test/rails_app/config/initializers/devise.rb b/test/rails_app/config/initializers/devise.rb index c7fb49ca..a39c4504 100644 --- a/test/rails_app/config/initializers/devise.rb +++ b/test/rails_app/config/initializers/devise.rb @@ -31,7 +31,7 @@ Devise.setup do |config| # session. If you need permissions, you should implement that in a before filter. # You can also supply hash where the value is a boolean expliciting if authentication # should be aborted or not if the value is not present. By default is empty. - # config.authentication_keys = [ :email ] + # config.authentication_keys = [:email] # Configure parameters from the request object used for authentication. Each entry # given should be a request method and it will automatically be passed to @@ -43,12 +43,12 @@ Devise.setup do |config| # Configure which authentication keys should be case-insensitive. # These keys will be downcased upon creating or modifying a user and when used # to authenticate or find a user. Default is :email. - config.case_insensitive_keys = [ :email ] + config.case_insensitive_keys = [:email] # Configure which authentication keys should have whitespace stripped. # These keys will have whitespace before and after removed upon creating or # modifying a user and when used to authenticate or find a user. Default is :email. - config.strip_whitespace_keys = [ :email ] + config.strip_whitespace_keys = [:email] # Tell if authentication through request.params is enabled. True by default. # config.params_authenticatable = true @@ -77,7 +77,7 @@ Devise.setup do |config| # config.allow_unconfirmed_access_for = 2.days # Defines which key will be used when confirming an account - # config.confirmation_keys = [ :email ] + # config.confirmation_keys = [:email] # ==> Configuration for :rememberable # The time the user will be remembered without asking for credentials again. @@ -105,7 +105,7 @@ Devise.setup do |config| # config.lock_strategy = :failed_attempts # Defines which key will be used when locking and unlocking an account - # config.unlock_keys = [ :email ] + # config.unlock_keys = [:email] # Defines which strategy will be used to unlock an account. # :email = Sends an unlock link to the user email @@ -124,7 +124,7 @@ Devise.setup do |config| # ==> Configuration for :recoverable # # Defines which key will be used when recovering the password for an account - # config.reset_password_keys = [ :email ] + # config.reset_password_keys = [:email] # Time interval you can reset your password with a reset password key. # Don't put a too small interval or your users won't have the time to diff --git a/test/test_models.rb b/test/test_models.rb index ee19b84a..3c1f1787 100644 --- a/test/test_models.rb +++ b/test/test_models.rb @@ -20,8 +20,8 @@ class UserWithCustomEncryption < User end class UserWithVirtualAttributes < User - devise case_insensitive_keys: [ :email, :email_confirmation ] - validates :email, presence: true, confirmation: {on: :create} + devise case_insensitive_keys: [:email, :email_confirmation] + validates :email, presence: true, confirmation: { on: :create } end class Several < Admin