From 12550a6a28939bf870c7ab1c8122028b122e6587 Mon Sep 17 00:00:00 2001 From: Matt Jankowski Date: Thu, 26 Oct 2023 17:20:41 -0400 Subject: [PATCH] Use `Rails.env.local?` shorthand method to check env (#27519) --- app/models/user.rb | 2 +- config/application.rb | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/app/models/user.rb b/app/models/user.rb index fa445af811..2ebf4a24bf 100644 --- a/app/models/user.rb +++ b/app/models/user.rb @@ -488,7 +488,7 @@ class User < ApplicationRecord end def validate_email_dns? - email_changed? && !external? && !(Rails.env.test? || Rails.env.development?) + email_changed? && !external? && !Rails.env.local? # rubocop:disable Rails/UnknownEnv end def validate_role_elevation diff --git a/config/application.rb b/config/application.rb index 7f7f8b5d6c..ad931fd36b 100644 --- a/config/application.rb +++ b/config/application.rb @@ -206,7 +206,7 @@ module Mastodon # We use our own middleware for this 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 Mastodon::RackMiddleware