Skip to content

Commit

Permalink
Bump rubocop-rails from 2.28.0 to 2.29.0 (#1190)
Browse files Browse the repository at this point in the history
* Bump rubocop-rails from 2.28.0 to 2.29.0

Bumps [rubocop-rails](https://github.com/rubocop/rubocop-rails) from 2.28.0 to 2.29.0.
- [Release notes](https://github.com/rubocop/rubocop-rails/releases)
- [Changelog](https://github.com/rubocop/rubocop-rails/blob/master/CHANGELOG.md)
- [Commits](rubocop/rubocop-rails@v2.28.0...v2.29.0)

---
updated-dependencies:
- dependency-name: rubocop-rails
  dependency-type: direct:development
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <[email protected]>

* Migrate over to :expect instead of :require.

This has uncovered some errors in tests.  We have also this "parent_id" / "parent_try_number" that may be something we can remove.

* Finished migration to expects, tries_controller fusses so ignoring that one place.

---------

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Eric Pugh <[email protected]>
  • Loading branch information
dependabot[bot] and epugh authored Jan 20, 2025
1 parent 357b4fa commit 0a32aba
Show file tree
Hide file tree
Showing 35 changed files with 127 additions and 127 deletions.
16 changes: 6 additions & 10 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -136,8 +136,8 @@ GEM
cmdstan (0.4.0)
csv
colorize (1.1.0)
concurrent-ruby (1.3.4)
connection_pool (2.4.1)
concurrent-ruby (1.3.5)
connection_pool (2.5.0)
crack (1.0.0)
bigdecimal
rexml
Expand Down Expand Up @@ -195,7 +195,6 @@ GEM
faraday (>= 1, < 3)
faraday-net_http (3.4.0)
net-http (>= 0.5.0)
ffi (1.17.1-aarch64-linux-gnu)
ffi (1.17.1-x86_64-darwin)
ffi (1.17.1-x86_64-linux-gnu)
foreman (0.88.1)
Expand All @@ -211,7 +210,7 @@ GEM
hashie (5.0.0)
heapy (0.2.0)
thor
i18n (1.14.6)
i18n (1.14.7)
concurrent-ruby (~> 1.0)
importmap-rails (2.1.0)
actionpack (>= 6.0.0)
Expand Down Expand Up @@ -255,7 +254,7 @@ GEM
rb-fsevent (~> 0.10, >= 0.10.3)
rb-inotify (~> 0.9, >= 0.9.10)
local_time (3.0.2)
logger (1.6.4)
logger (1.6.5)
loofah (2.23.1)
crass (~> 1.0.2)
nokogiri (>= 1.12.0)
Expand Down Expand Up @@ -306,8 +305,6 @@ GEM
net-smtp (0.5.0)
net-protocol
nio4r (2.7.4)
nokogiri (1.18.1-aarch64-linux-gnu)
racc (~> 1.4)
nokogiri (1.18.1-x86_64-darwin)
racc (~> 1.4)
nokogiri (1.18.1-x86_64-linux-gnu)
Expand Down Expand Up @@ -343,7 +340,7 @@ GEM
orm_adapter (0.5.0)
ostruct (0.6.1)
parallel (1.26.3)
parser (3.3.6.0)
parser (3.3.7.0)
ast (~> 2.4.1)
racc
postmark (1.25.1)
Expand Down Expand Up @@ -445,7 +442,7 @@ GEM
parser (>= 3.3.1.0)
rubocop-capybara (2.21.0)
rubocop (~> 1.41)
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 Expand Up @@ -539,7 +536,6 @@ GEM
zeitwerk (2.7.1)

PLATFORMS
aarch64-linux
x86_64-darwin-22
x86_64-linux

Expand Down
2 changes: 1 addition & 1 deletion app/assets/javascripts/services/settingsSvc.js
Original file line number Diff line number Diff line change
Expand Up @@ -503,7 +503,7 @@ angular.module('QuepidApp')
var payloadSearchEndpoint = {};
payload.try = payloadTry;
payload.search_endpoint = payloadSearchEndpoint;
payload.parent_try_number = settingsToSave.selectedTry.tryNo;
payload.parent_try_number = settingsToSave.selectedTry.tryNo; // track the parent try for ancestry
payload.curator_vars = settingsToSave.selectedTry.curatorVarsDict();

// We create the default name on the server side
Expand Down
2 changes: 1 addition & 1 deletion app/controllers/admin/announcements_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ def publish
private

def announcement_params
params.require(:announcement).permit(:text, :author_id)
params.expect(announcement: [ :text, :author_id ])
end
end
end
18 changes: 9 additions & 9 deletions app/controllers/admin/communal_scorers_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -82,15 +82,15 @@ def destroy
def scorer_params
return unless params[:scorer]

params.require(:scorer).permit(
:code,
:name,
:communal,
:show_scale_labels,
:scale_list, # alternate approach to the scale:[] array used in admin only
:state,
scale: [],
scale_with_labels: {}
params.expect(
scorer: [ :code,
:name,
:communal,
:show_scale_labels,
:scale_list, # alternate approach to the scale:[] array used in admin only
:state,
{ scale: [],
scale_with_labels: {} } ]
)
end

Expand Down
14 changes: 7 additions & 7 deletions app/controllers/admin/users_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -132,13 +132,13 @@ def set_user

# Never trust parameters from the scary internet, only allow the permitted list through.
def user_params
params.require(:user).permit(
:administrator,
:email,
:name,
:company,
:password,
:password_confirmation
params.expect(
user: [ :administrator,
:email,
:name,
:company,
:password,
:password_confirmation ]
)
end
end
Expand Down
4 changes: 2 additions & 2 deletions app/controllers/ai_judges/prompts_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,8 @@ def ai_judge_params
end

def query_doc_pair_params
params.require(:query_doc_pair).permit(:document_fields, :position, :query_text, :doc_id, :notes,
:information_need, options: {})
params.expect(query_doc_pair: [ :document_fields, :position, :query_text, :doc_id, :notes,
:information_need, { options: {} } ])
end
end
end
16 changes: 8 additions & 8 deletions app/controllers/api/v1/annotations_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -60,18 +60,18 @@ def set_annotation
end

def annotation_params
params.require(:annotation).permit(
:message,
:source
params.expect(
annotation: [ :message,
:source ]
)
end

def score_params
params.require(:score).permit(
:all_rated,
:score,
:try_id,
queries: []
params.expect(
score: [ :all_rated,
:score,
:try_id,
{ queries: [] } ]
)
end
end
Expand Down
4 changes: 2 additions & 2 deletions app/controllers/api/v1/books_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -127,8 +127,8 @@ def destroy
private

def book_params
params.require(:book).permit(:scorer_id, :selection_strategy_id, :name, :support_implicit_judgements,
:show_rank)
params.expect(book: [ :scorer_id, :selection_strategy_id, :name, :support_implicit_judgements,
:show_rank ])
end

def set_book
Expand Down
2 changes: 1 addition & 1 deletion app/controllers/api/v1/case_metadata_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ def update
private

def metadata_params
params.require(:metadata).permit(:last_viewed_at)
params.expect(metadata: [ :last_viewed_at ])
end
end
end
Expand Down
3 changes: 3 additions & 0 deletions app/controllers/api/v1/case_scores_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,8 @@ def update

private

# rubocop:disable Rails/StrongParametersExpect
# tried to migrate and had no love.
def score_params
params.require(:case_score).permit(
:score,
Expand All @@ -69,6 +71,7 @@ def score_params
queries: [ :text, :score, :maxScore, :numFound ]
)
end
# rubocop:enable Rails/StrongParametersExpect
end
end
end
2 changes: 1 addition & 1 deletion app/controllers/api/v1/cases_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ def destroy
private

def case_params
params.require(:case).permit(:case_name, :scorer_id, :archived, :book_id, :last_try_number, :nightly)
params.expect(case: [ :case_name, :scorer_id, :archived, :book_id, :last_try_number, :nightly ])
end

def default_scorer_removed? params = {}
Expand Down
12 changes: 6 additions & 6 deletions app/controllers/api/v1/clone/tries_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -47,12 +47,12 @@ def set_try
end

def try_params
params.require(:try).permit(
:name,
:field_spec,
:query_params,
:escape_query,
:number_of_rows
params.expect(
try: [ :name,
:field_spec,
:query_params,
:escape_query,
:number_of_rows ]
)
end
end
Expand Down
2 changes: 1 addition & 1 deletion app/controllers/api/v1/judgements_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ def destroy
private

def judgement_params
params.require(:judgement).permit(:rating, :unrateable, :query_doc_pair_id, :user_id, :explanation)
params.expect(judgement: [ :rating, :unrateable, :query_doc_pair_id, :user_id, :explanation ])
end

def set_judgement
Expand Down
2 changes: 1 addition & 1 deletion app/controllers/api/v1/queries/notes_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ def update
private

def query_params
params.require(:query).permit(:notes, :information_need)
params.expect(query: [ :notes, :information_need ])
end
end
end
Expand Down
2 changes: 1 addition & 1 deletion app/controllers/api/v1/queries/options_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ def update
private

def query_params
params.require(:query).permit(options: {})
params.expect(query: [ options: {} ])
end
end
end
Expand Down
2 changes: 1 addition & 1 deletion app/controllers/api/v1/queries/ratings_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ def destroy
private

def rating_params
params.require(:rating).permit(:rating, :doc_id)
params.expect(rating: [ :rating, :doc_id ])
end

def set_doc_id
Expand Down
2 changes: 1 addition & 1 deletion app/controllers/api/v1/queries_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ def destroy
private

def query_params
params.require(:query).permit(:query_text, :information_need, :notes, options: {})
params.expect(query: [ :query_text, :information_need, :notes, { options: {} } ])
end
end
end
Expand Down
4 changes: 2 additions & 2 deletions app/controllers/api/v1/query_doc_pairs_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -102,8 +102,8 @@ def destroy
private

def query_doc_pair_params
params.require(:query_doc_pair).permit(:document_fields, :position, :query_text, :doc_id, :notes,
:information_need, options: {})
params.expect(query_doc_pair: [ :document_fields, :position, :query_text, :doc_id, :notes,
:information_need, { options: {} } ])
end

def set_query_doc_pair
Expand Down
14 changes: 7 additions & 7 deletions app/controllers/api/v1/scorers_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -151,13 +151,13 @@ def destroy
def scorer_params
return unless params[:scorer]

params.require(:scorer).permit(
:code,
:name,
:show_scale_labels,
:communal,
scale: [],
scale_with_labels: {}
params.expect(
scorer: [ :code,
:name,
:show_scale_labels,
:communal,
{ scale: [],
scale_with_labels: {} } ]
)
end

Expand Down
6 changes: 3 additions & 3 deletions app/controllers/api/v1/search_endpoints_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -110,9 +110,9 @@ def set_search_endpoint
end

def search_endpoint_params
params.require(:search_endpoint).permit(:api_method, :archived, :basic_auth_credential, :custom_headers,
:endpoint_url, :mapper_code, :name, :proxy_requests, :search_engine,
options: {})
params.expect(search_endpoint: [ :api_method, :archived, :basic_auth_credential, :custom_headers,
:endpoint_url, :mapper_code, :name, :proxy_requests, :search_engine,
{ options: {} } ])
end
end
end
Expand Down
12 changes: 6 additions & 6 deletions app/controllers/api/v1/signups_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -36,12 +36,12 @@ def create
private

def user_params
params.require(:user).permit(
:name,
:email,
:password,
:agreed,
:email_marketing
params.expect(
user: [ :name,
:email,
:password,
:agreed,
:email_marketing ]
)
end
end
Expand Down
2 changes: 1 addition & 1 deletion app/controllers/api/v1/teams_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ def destroy
private

def team_params
params.require(:team).permit(:name)
params.expect(team: [ :name ])
end
end
end
Expand Down
Loading

0 comments on commit 0a32aba

Please sign in to comment.