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

Replace to use of ActionController::Parameters#expect for strong parameter #147

Merged
merged 1 commit into from
Jan 20, 2025
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
2 changes: 2 additions & 0 deletions .rubocop.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,3 +6,5 @@ inherit_gem: { rubocop-rails-omakase: rubocop.yml }
# # Use `[a, [b, c]]` not `[ a, [ b, c ] ]`
# Layout/SpaceInsideArrayLiteralBrackets:
# Enabled: false
Rails/StrongParametersExpect:
Enabled: true
4 changes: 2 additions & 2 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,7 @@ GEM
foreman (0.88.1)
globalid (1.2.1)
activesupport (>= 6.1)
i18n (1.14.6)
i18n (1.14.7)
concurrent-ruby (~> 1.0)
io-console (0.8.0)
irb (1.14.3)
Expand Down Expand Up @@ -322,7 +322,7 @@ GEM
rubocop-performance (1.23.1)
rubocop (>= 1.48.1, < 2.0)
rubocop-ast (>= 1.31.1, < 2.0)
rubocop-rails (2.28.0)
rubocop-rails (2.29.0)
activesupport (>= 4.2.0)
rack (>= 1.1)
rubocop (>= 1.52.0, < 2.0)
Expand Down
2 changes: 1 addition & 1 deletion app/controllers/diagnosis_logs_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,6 @@ def set_diagnosis_log

# Never trust parameters from the scary internet, only allow the white list through.
def diagnosis_log_params
params.require(:diagnosis_log).permit(:layer, :log_group, :log_type, :target, :log_campaign_uuid, :result, :detail, :occurred_at)
params.expect(diagnosis_log: [ :layer, :log_group, :log_type, :target, :log_campaign_uuid, :result, :detail, :occurred_at ])
end
end
2 changes: 1 addition & 1 deletion app/controllers/ignore_error_results_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,6 @@ def set_ignore_error_result

# Never trust parameters from the scary internet, only allow the white list through.
def ignore_error_result_params
params.require(:ignore_error_result).permit(:ssid, ignore_log_types: [])
params.expect(ignore_error_result: [ :ssid, ignore_log_types: [] ])
end
end
2 changes: 1 addition & 1 deletion app/controllers/log_campaigns_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -135,6 +135,6 @@ def set_log_campaign

# Never trust parameters from the scary internet, only allow the white list through.
def log_campaign_params
params.require(:log_campaign).permit(:log_campaign_uuid, :ssid, :network_type, :mac_addr, :os, :version, :occurred_at)
params.expect(log_campaign: [ :log_campaign_uuid, :ssid, :network_type, :mac_addr, :os, :version, :occurred_at ])
end
end
Loading