Skip to content

Commit

Permalink
A new cop (Style/HashSlice) has been merge
Browse files Browse the repository at this point in the history
rubocop/rubocop#13507

We should make the changes to our code
  • Loading branch information
avinhurry committed Jan 23, 2025
1 parent 4738e47 commit e0d743e
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ def title

PERSISTENT_ATTRIBUTES = %w[qualification_type other_uk_qualification_type non_uk_qualification_type subject predicted_grade grade award_year institution_country].freeze
def persistent_attributes(application_qualification)
application_qualification.attributes.select { |key, _| PERSISTENT_ATTRIBUTES.include?(key) }
application_qualification.attributes.slice(*PERSISTENT_ATTRIBUTES)
end

def grade_hint
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ def tailored_advice_reasons
hash.delete('safeguarding')
end

hash.filter { |key, _value| key.in? VALID_HIGH_LEVEL_ADVICE_REASON_CODES }
hash.slice(*VALID_HIGH_LEVEL_ADVICE_REASON_CODES)
end

def render_tailored_advice_section_headings?
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,7 @@ class GetIncompleteReferenceApplicationsReadyToNudge
end

def call
uk_and_irish_names = NATIONALITIES.select do |code, _name|
code.in?(ApplicationForm::BRITISH_OR_IRISH_NATIONALITIES)
end.map(&:second)
uk_and_irish_names = NATIONALITIES.slice(*ApplicationForm::BRITISH_OR_IRISH_NATIONALITIES).map(&:second)

ApplicationForm
# Only candidates with application_choices
Expand Down
4 changes: 1 addition & 3 deletions app/queries/get_unsubmitted_applications_ready_to_nudge.rb
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,7 @@ class GetUnsubmittedApplicationsReadyToNudge
.map { |field| "#{field}_completed" }.freeze

def call
uk_and_irish_names = NATIONALITIES.select do |code, _name|
code.in?(ApplicationForm::BRITISH_OR_IRISH_NATIONALITIES)
end.map(&:second)
uk_and_irish_names = NATIONALITIES.slice(*ApplicationForm::BRITISH_OR_IRISH_NATIONALITIES).map(&:second)

ApplicationForm
# Only candidates with unsubmitted application_choices
Expand Down

0 comments on commit e0d743e

Please sign in to comment.