Skip to content

Commit

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

Bump rubocop-govuk from 5.0.2 to 5.0.5
  • Loading branch information
pezholio authored Dec 5, 2024
2 parents 00f354d + 2d41dfc commit 470822c
Show file tree
Hide file tree
Showing 7 changed files with 25 additions and 37 deletions.
33 changes: 16 additions & 17 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -376,7 +376,7 @@ GEM
jbuilder (2.13.0)
actionview (>= 5.0.0)
activesupport (>= 5.0.0)
json (2.8.2)
json (2.9.0)
json-schema (4.3.0)
addressable (>= 2.8)
json_schemer (2.3.0)
Expand Down Expand Up @@ -742,7 +742,7 @@ GEM
term-ansicolor (~> 1.7)
thor (>= 0.20, < 2.0)
parallel (1.26.3)
parser (3.3.5.0)
parser (3.3.6.0)
ast (~> 2.4.1)
racc
parslet (2.0.0)
Expand Down Expand Up @@ -835,7 +835,7 @@ GEM
redis (4.8.1)
redis-client (0.22.2)
connection_pool
regexp_parser (2.9.2)
regexp_parser (2.9.3)
reline (0.5.12)
io-console (~> 0.5)
request_store (1.7.0)
Expand Down Expand Up @@ -864,36 +864,35 @@ GEM
diff-lcs (>= 1.2.0, < 2.0)
rspec-support (~> 3.13.0)
rspec-support (3.13.1)
rubocop (1.64.1)
rubocop (1.69.1)
json (~> 2.3)
language_server-protocol (>= 3.17.0)
parallel (~> 1.10)
parser (>= 3.3.0.2)
rainbow (>= 2.2.2, < 4.0)
regexp_parser (>= 1.8, < 3.0)
rexml (>= 3.2.5, < 4.0)
rubocop-ast (>= 1.31.1, < 2.0)
regexp_parser (>= 2.9.3, < 3.0)
rubocop-ast (>= 1.36.2, < 2.0)
ruby-progressbar (~> 1.7)
unicode-display_width (>= 2.4.0, < 3.0)
rubocop-ast (1.31.3)
unicode-display_width (>= 2.4.0, < 4.0)
rubocop-ast (1.36.2)
parser (>= 3.3.1.0)
rubocop-capybara (2.21.0)
rubocop (~> 1.41)
rubocop-govuk (5.0.2)
rubocop (= 1.64.1)
rubocop-ast (= 1.31.3)
rubocop-govuk (5.0.5)
rubocop (= 1.69.1)
rubocop-ast (= 1.36.2)
rubocop-capybara (= 2.21.0)
rubocop-rails (= 2.25.1)
rubocop-rails (= 2.27.0)
rubocop-rake (= 0.6.0)
rubocop-rspec (= 3.0.1)
rubocop-rails (2.25.1)
rubocop-rspec (= 3.2.0)
rubocop-rails (2.27.0)
activesupport (>= 4.2.0)
rack (>= 1.1)
rubocop (>= 1.33.0, < 2.0)
rubocop (>= 1.52.0, < 2.0)
rubocop-ast (>= 1.31.1, < 2.0)
rubocop-rake (0.6.0)
rubocop (~> 1.0)
rubocop-rspec (3.0.1)
rubocop-rspec (3.2.0)
rubocop (~> 1.61)
ruby-progressbar (1.13.0)
ruby-rc4 (0.1.5)
Expand Down
14 changes: 1 addition & 13 deletions app/models/republishing_event.rb
Original file line number Diff line number Diff line change
Expand Up @@ -17,19 +17,7 @@ class RepublishingEvent < ApplicationRecord
validates :content_ids, absence: true, unless: -> { bulk_content_type == "all_documents_by_content_ids" }
validate :content_ids_is_a_non_empty_array_of_strings, if: -> { bulk_content_type == "all_documents_by_content_ids" }

enum :bulk_content_type, %i[
all_documents
all_documents_with_pre_publication_editions
all_documents_with_pre_publication_editions_with_html_attachments
all_documents_with_publicly_visible_editions_with_attachments
all_documents_with_publicly_visible_editions_with_html_attachments
all_individual_pages
all_non_editionable_content
all_published_organisation_about_us_pages
all_by_type
all_documents_by_organisation
all_documents_by_content_ids
]
enum :bulk_content_type, { all_documents: 0, all_documents_with_pre_publication_editions: 1, all_documents_with_pre_publication_editions_with_html_attachments: 2, all_documents_with_publicly_visible_editions_with_attachments: 3, all_documents_with_publicly_visible_editions_with_html_attachments: 4, all_individual_pages: 5, all_non_editionable_content: 6, all_published_organisation_about_us_pages: 7, all_by_type: 8, all_documents_by_organisation: 9, all_documents_by_content_ids: 10 }

def content_ids_is_a_non_empty_array_of_strings
return errors.add(:content_ids, "is not an array") unless content_ids.is_a?(Array)
Expand Down
2 changes: 1 addition & 1 deletion app/presenters/publishing_api/person_presenter.rb
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ def links
def details
details_hash = {}

if item.image&.all_asset_variants_uploaded? && item.image&.url(:s465)
if item.image&.all_asset_variants_uploaded? && item.image.url(:s465)
logger.error("PersonPresenter: Person of ID##{item.id} has image with url '#{item.image&.url(:s465)}'") if item.image.url(:s465).include?("carrierwave-tmp")
details_hash[:image] = { url: item.image.url(:s465), alt_text: item.name }
end
Expand Down
2 changes: 1 addition & 1 deletion app/presenters/publishing_api/take_part_presenter.rb
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ def details
end

def image_url
return item.image.url(:s300) if item.image&.all_asset_variants_uploaded? && item.image&.url(:s300)
return item.image.url(:s300) if item.image&.all_asset_variants_uploaded? && item.image.url(:s300)

placeholder_image_url
end
Expand Down
1 change: 0 additions & 1 deletion app/sidekiq/publishing_api_worker.rb
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ def perform(model_name,
update_type = nil,
locale = I18n.default_locale.to_s,
bulk_publishing = false)

model = class_for(model_name).unscoped.find_by(id:)
return if model.nil?

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -341,7 +341,9 @@ def up

## We only want to capture the first create event as a "create", every other draft CIP created should be a "update"
## Otherwise we get "Document created" appear within the history of the draft edition
# rubocop:disable Lint/Void
create_exists if version.event == "create"
# rubocop:enable Lint/Void
end

## Override the draft edition's timestamps to reflect the draft CIPs we have used to create it
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,17 +14,17 @@ class ContentBlockManager::FindAndReplaceEmbedCodesServiceTest < ActiveSupport::
document_2.latest_edition = edition_2
document_2.save!

html = """
html = "
<p>Hello there</p>
<p>#{edition_2.document.embed_code}</p>
<p>#{edition_1.document.embed_code}</p>
"""
"

expected = """
expected = "
<p>Hello there</p>
<p>#{edition_2.render}</p>
<p>#{edition_1.render}</p>
"""
"

result = ContentBlockManager::FindAndReplaceEmbedCodesService.call(html)

Expand Down

0 comments on commit 470822c

Please sign in to comment.