Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Enable class and module children cop #549

Merged
merged 2 commits into from
Aug 31, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading