Skip to content

Commit

Permalink
Merge branch 'main' into support-rails-7-2
Browse files Browse the repository at this point in the history
  • Loading branch information
eoinkelly authored Aug 31, 2024
2 parents 1bffe44 + 4a1ed87 commit 51c71ba
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 18 deletions.
3 changes: 0 additions & 3 deletions .rubocop.yml
Original file line number Diff line number Diff line change
Expand Up @@ -225,9 +225,6 @@ Rails/Output:
Style/BarePercentLiterals:
EnforcedStyle: percent_q

Style/ClassAndModuleChildren:
Enabled: false

Style/DoubleNegation:
Enabled: false

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,23 +4,25 @@
# Copied from
# https://github.com/rails/rails/blob/main/activestorage/app/controllers/active_storage/base_controller.rb
# :nocov:
class ActiveStorage::BaseController < ActionController::Base # rubocop:disable Rails/ApplicationController
include ActiveStorage::SetCurrent
module ActiveStorage
class BaseController < ActionController::Base # rubocop:disable Rails/ApplicationController
include ActiveStorage::SetCurrent

protect_from_forgery with: :exception
protect_from_forgery with: :exception

before_action :authenticated?
before_action :authenticated?

self.etag_with_template_digest = false
self.etag_with_template_digest = false

private
private

# ActiveStorage defaults to security via obscurity approach to serving links
# If this is acceptable for your use case then this authenticable test can be
# removed. If not then code should be added to only serve files appropriately.
# https://edgeguides.rubyonrails.org/active_storage_overview.html#proxy-mode
def authenticated?
raise StandardError, "No authentication is configured for ActiveStorage"
# ActiveStorage defaults to security via obscurity approach to serving links
# If this is acceptable for your use case then this authenticable test can be
# removed. If not then code should be added to only serve files appropriately.
# https://edgeguides.rubyonrails.org/active_storage_overview.html#proxy-mode
def authenticated?
raise StandardError, "No authentication is configured for ActiveStorage"
end
end
end
# :nocov:
3 changes: 0 additions & 3 deletions variants/backend-base/rubocop.yml.tt
Original file line number Diff line number Diff line change
Expand Up @@ -252,9 +252,6 @@ Rails/Output:
Style/BarePercentLiterals:
EnforcedStyle: percent_q

Style/ClassAndModuleChildren:
Enabled: false

Style/DoubleNegation:
Enabled: false

Expand Down

0 comments on commit 51c71ba

Please sign in to comment.