mirror of https://github.com/Siphonay/mastodon
Use `Rails.env.local?` shorthand method to check env (#27519)
This commit is contained in:
parent
4aa05d45fc
commit
12550a6a28
|
@ -488,7 +488,7 @@ class User < ApplicationRecord
|
||||||
end
|
end
|
||||||
|
|
||||||
def validate_email_dns?
|
def validate_email_dns?
|
||||||
email_changed? && !external? && !(Rails.env.test? || Rails.env.development?)
|
email_changed? && !external? && !Rails.env.local? # rubocop:disable Rails/UnknownEnv
|
||||||
end
|
end
|
||||||
|
|
||||||
def validate_role_elevation
|
def validate_role_elevation
|
||||||
|
|
|
@ -206,7 +206,7 @@ module Mastodon
|
||||||
# We use our own middleware for this
|
# We use our own middleware for this
|
||||||
config.public_file_server.enabled = false
|
config.public_file_server.enabled = false
|
||||||
|
|
||||||
config.middleware.use PublicFileServerMiddleware if Rails.env.development? || Rails.env.test? || ENV['RAILS_SERVE_STATIC_FILES'] == 'true'
|
config.middleware.use PublicFileServerMiddleware if Rails.env.local? || ENV['RAILS_SERVE_STATIC_FILES'] == 'true' # rubocop:disable Rails/UnknownEnv
|
||||||
config.middleware.use Rack::Attack
|
config.middleware.use Rack::Attack
|
||||||
config.middleware.use Mastodon::RackMiddleware
|
config.middleware.use Mastodon::RackMiddleware
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue