Skip to content

Commit

Permalink
Merge pull request #2615 from alphagov/dependabot/bundler/rubocop-gov…
Browse files Browse the repository at this point in the history
…uk-4.13.0

Bump rubocop-govuk from 4.12.0 to 4.13.0
  • Loading branch information
floehopper authored Jan 2, 2024
2 parents 45e7ac2 + 5efbf65 commit 896a454
Show file tree
Hide file tree
Showing 9 changed files with 22 additions and 21 deletions.
25 changes: 13 additions & 12 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -585,37 +585,38 @@ GEM
chunky_png (~> 1.0)
rqrcode_core (~> 1.0)
rqrcode_core (1.2.0)
rubocop (1.55.0)
rubocop (1.59.0)
json (~> 2.3)
language_server-protocol (>= 3.17.0)
parallel (~> 1.10)
parser (>= 3.2.2.3)
parser (>= 3.2.2.4)
rainbow (>= 2.2.2, < 4.0)
regexp_parser (>= 1.8, < 3.0)
rexml (>= 3.2.5, < 4.0)
rubocop-ast (>= 1.28.1, < 2.0)
rubocop-ast (>= 1.30.0, < 2.0)
ruby-progressbar (~> 1.7)
unicode-display_width (>= 2.4.0, < 3.0)
rubocop-ast (1.29.0)
rubocop-ast (1.30.0)
parser (>= 3.2.1.0)
rubocop-capybara (2.19.0)
rubocop (~> 1.41)
rubocop-factory_bot (2.24.0)
rubocop (~> 1.33)
rubocop-govuk (4.12.0)
rubocop (= 1.55.0)
rubocop-ast (= 1.29.0)
rubocop-rails (= 2.20.2)
rubocop-govuk (4.13.0)
rubocop (= 1.59.0)
rubocop-ast (= 1.30.0)
rubocop-rails (= 2.23.0)
rubocop-rake (= 0.6.0)
rubocop-rspec (= 2.22.0)
rubocop-rails (2.20.2)
rubocop-rspec (= 2.25.0)
rubocop-rails (2.23.0)
activesupport (>= 4.2.0)
rack (>= 1.1)
rubocop (>= 1.33.0, < 2.0)
rubocop-ast (>= 1.30.0, < 2.0)
rubocop-rake (0.6.0)
rubocop (~> 1.0)
rubocop-rspec (2.22.0)
rubocop (~> 1.33)
rubocop-rspec (2.25.0)
rubocop (~> 1.40)
rubocop-capybara (~> 2.17)
rubocop-factory_bot (~> 2.22)
ruby-progressbar (1.13.0)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@ class StripWhitespaceFromUsersNames < ActiveRecord::Migration[7.0]
NAME_HAS_LEADING_OR_TRAILING_SPACE = "name REGEXP('^\s+') OR name REGEXP('\s+$')".freeze

def up
User.where(NAME_HAS_LEADING_OR_TRAILING_SPACE).each(&:save!)
User.where(NAME_HAS_LEADING_OR_TRAILING_SPACE).find_each(&:save!)

BatchInvitationUser.where(NAME_HAS_LEADING_OR_TRAILING_SPACE).each(&:save!)
BatchInvitationUser.where(NAME_HAS_LEADING_OR_TRAILING_SPACE).find_each(&:save!)
end

def down; end
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ class StripWhitespaceFromOrganisationNames < ActiveRecord::Migration[7.0]
NAME_HAS_LEADING_OR_TRAILING_SPACE = "name REGEXP('^\s+') OR name REGEXP('\s+$')".freeze

def up
Organisation.where(NAME_HAS_LEADING_OR_TRAILING_SPACE).each(&:save!)
Organisation.where(NAME_HAS_LEADING_OR_TRAILING_SPACE).find_each(&:save!)
end

def down; end
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
class StripWhitespaceFromBatchInvitationUserEmail < ActiveRecord::Migration[7.0]
def change
BatchInvitationUser.where("email REGEXP ? OR email REGEXP ?", "^\\s+", "\\s+$").each do |biu|
BatchInvitationUser.where("email REGEXP ? OR email REGEXP ?", "^\\s+", "\\s+$").find_each do |biu|
biu.update_attribute(:email, biu.email&.strip) # rubocop:disable Rails/SkipsModelValidations
end
end
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
class StripWhitespaceFromBatchInvitationUserOrganisationSlug < ActiveRecord::Migration[7.0]
def change
BatchInvitationUser.where("organisation_slug REGEXP ? OR organisation_slug REGEXP ?", "^\\s+", "\\s+$").each do |biu|
BatchInvitationUser.where("organisation_slug REGEXP ? OR organisation_slug REGEXP ?", "^\\s+", "\\s+$").find_each do |biu|
biu.update_attribute(:organisation_slug, biu.organisation_slug&.strip) # rubocop:disable Rails/SkipsModelValidations
end
end
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
class StripWhitespaceFromUserName < ActiveRecord::Migration[7.0]
def change
User.where("name REGEXP ? OR name REGEXP ?", "^\\s+", "\\s+$").each do |u|
User.where("name REGEXP ? OR name REGEXP ?", "^\\s+", "\\s+$").find_each do |u|
u.update_attribute(:name, u.name&.strip) # rubocop:disable Rails/SkipsModelValidations
end
end
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
class StripWhitespaceFromBatchInvitationUserName < ActiveRecord::Migration[7.0]
def change
BatchInvitationUser.where("name REGEXP ? OR name REGEXP ?", "^\\s+", "\\s+$").each do |u|
BatchInvitationUser.where("name REGEXP ? OR name REGEXP ?", "^\\s+", "\\s+$").find_each do |u|
u.update_attribute(:name, u.name&.strip) # rubocop:disable Rails/SkipsModelValidations
end
end
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
class StripWhitespaceFromOrganisationName < ActiveRecord::Migration[7.0]
def change
Organisation.where("name REGEXP ? OR name REGEXP ?", "^\\s+", "\\s+$").each do |o|
Organisation.where("name REGEXP ? OR name REGEXP ?", "^\\s+", "\\s+$").find_each do |o|
o.update_attribute(:name, o.name&.strip) # rubocop:disable Rails/SkipsModelValidations
end
end
Expand Down
2 changes: 1 addition & 1 deletion lib/user_permission_migrator.rb
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ def self.migrate(source:, target:)

permission_mappings = permissions.to_h

User.all.each do |user|
User.all.find_each do |user|
next unless user.has_access_to?(source_app)

permissions = user.permissions_for(source_app)
Expand Down

0 comments on commit 896a454

Please sign in to comment.