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

Do a final pass removing spaces around square brackets

Keep plataformatec guidelines and review tools happy.
Related to #3480.
This commit is contained in:
Carlos Antonio da Silva 2015-03-13 13:48:14 -03:00
parent 1ab2d51308
commit 868d3d82a0
10 changed files with 18 additions and 18 deletions

View file

@ -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

View file

@ -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

View file

@ -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

View file

@ -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)
[]

View file

@ -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.
#

View file

@ -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

View file

@ -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|

View file

@ -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)

View file

@ -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

View file

@ -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