Use parentheses for multi-line method calls

Own style guide says we should be using parentheses for method calls
with arguments.
上级 d3893ec3
......@@ -174,8 +174,9 @@ def key_generator
# team. Details at https://github.com/rails/rails/pull/6952#issuecomment-7661220
@caching_key_generator ||=
if secret_key_base
ActiveSupport::CachingKeyGenerator.new \
ActiveSupport::CachingKeyGenerator.new(
ActiveSupport::KeyGenerator.new(secret_key_base, iterations: 1000)
)
else
ActiveSupport::LegacyKeyGenerator.new(secrets.secret_token)
end
......@@ -400,8 +401,9 @@ def secrets
secrets.secret_token ||= config.secret_token
if secrets.secret_token.present?
ActiveSupport::Deprecation.warn \
ActiveSupport::Deprecation.warn(
"`secrets.secret_token` is deprecated in favor of `secret_key_base` and will be removed in Rails 6.0."
)
end
secrets
......@@ -424,8 +426,9 @@ def secret_key_base
if Rails.env.test? || Rails.env.development?
Digest::MD5.hexdigest self.class.name
else
validate_secret_key_base \
validate_secret_key_base(
ENV["SECRET_KEY_BASE"] || credentials.secret_key_base || secrets.secret_key_base
)
end
end
......@@ -464,10 +467,11 @@ def credentials
#
# Rails.application.encrypted("config/special_tokens.yml.enc", key_path: "config/special_tokens.key")
def encrypted(path, key_path: "config/master.key", env_key: "RAILS_MASTER_KEY")
ActiveSupport::EncryptedConfiguration.new \
ActiveSupport::EncryptedConfiguration.new(
config_path: Rails.root.join(path),
key_path: Rails.root.join(key_path),
env_key: env_key
)
end
def to_app #:nodoc:
......
......@@ -31,10 +31,11 @@ def add_credentials_file_silently(template = nil)
private
def credentials
ActiveSupport::EncryptedConfiguration.new \
ActiveSupport::EncryptedConfiguration.new(
config_path: "config/credentials.yml.enc",
key_path: "config/master.key",
env_key: "RAILS_MASTER_KEY"
)
end
def credentials_template
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册