Skip to content

Commit

Permalink
Use Rails.env.local? shorthand method to check env (mastodon#27519)
Browse files Browse the repository at this point in the history
  • Loading branch information
mjankowski authored Oct 26, 2023
1 parent 4aa05d4 commit 12550a6
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion app/models/user.rb
Original file line number Diff line number Diff line change
Expand Up @@ -488,7 +488,7 @@ def needs_feed_update?
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
Expand Down
2 changes: 1 addition & 1 deletion config/application.rb
Original file line number Diff line number Diff line change
Expand Up @@ -206,7 +206,7 @@ class Application < Rails::Application
# 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

Expand Down

0 comments on commit 12550a6

Please sign in to comment.