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

Apply rails 7.1 update #2343

Merged
merged 2 commits into from
Oct 7, 2024
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
5 changes: 3 additions & 2 deletions Gemfile
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
source "https://rubygems.org"

gem "rails", "7.0.8.3"
gem "rails", "7.1.4"

gem "aws-sdk-s3", "~> 1"
gem "bootsnap", require: false
Expand All @@ -27,7 +27,7 @@ gem "mail-notify"
gem "mlanett-redis-lock"
gem "momentjs-rails"
gem "mongo"
gem "mongoid"
gem "mongoid", "8.1.4" # Locked as Mongoid 8.1.5 changes validation behaviour https://github.com/mongodb/mongoid/releases/tag/v8.1.5
gem "mongoid-sadstory"
gem "mousetrap-rails"
gem "nested_form", git: "https://github.com/alphagov/nested_form.git", branch: "add-wrapper-class"
Expand All @@ -38,6 +38,7 @@ gem "rails_autolink"
gem "rest-client", require: false
gem "select2-rails", "~> 3.5.9" # Updating this will mean updating the styling as 4 & > have a new approach to class names.
gem "sentry-sidekiq"
gem "sidekiq", "< 7" # Disables Sidekiq 7 beta opt-in.
gem "sprockets-rails"
gem "state_machines"
gem "state_machines-mongoid"
Expand Down
179 changes: 105 additions & 74 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -8,70 +8,79 @@ GIT
GEM
remote: https://rubygems.org/
specs:
actioncable (7.0.8.3)
actionpack (= 7.0.8.3)
activesupport (= 7.0.8.3)
actioncable (7.1.4)
actionpack (= 7.1.4)
activesupport (= 7.1.4)
nio4r (~> 2.0)
websocket-driver (>= 0.6.1)
actionmailbox (7.0.8.3)
actionpack (= 7.0.8.3)
activejob (= 7.0.8.3)
activerecord (= 7.0.8.3)
activestorage (= 7.0.8.3)
activesupport (= 7.0.8.3)
zeitwerk (~> 2.6)
actionmailbox (7.1.4)
actionpack (= 7.1.4)
activejob (= 7.1.4)
activerecord (= 7.1.4)
activestorage (= 7.1.4)
activesupport (= 7.1.4)
mail (>= 2.7.1)
net-imap
net-pop
net-smtp
actionmailer (7.0.8.3)
actionpack (= 7.0.8.3)
actionview (= 7.0.8.3)
activejob (= 7.0.8.3)
activesupport (= 7.0.8.3)
actionmailer (7.1.4)
actionpack (= 7.1.4)
actionview (= 7.1.4)
activejob (= 7.1.4)
activesupport (= 7.1.4)
mail (~> 2.5, >= 2.5.4)
net-imap
net-pop
net-smtp
rails-dom-testing (~> 2.0)
actionpack (7.0.8.3)
actionview (= 7.0.8.3)
activesupport (= 7.0.8.3)
rack (~> 2.0, >= 2.2.4)
rails-dom-testing (~> 2.2)
actionpack (7.1.4)
actionview (= 7.1.4)
activesupport (= 7.1.4)
nokogiri (>= 1.8.5)
racc
rack (>= 2.2.4)
rack-session (>= 1.0.1)
rack-test (>= 0.6.3)
rails-dom-testing (~> 2.0)
rails-html-sanitizer (~> 1.0, >= 1.2.0)
actiontext (7.0.8.3)
actionpack (= 7.0.8.3)
activerecord (= 7.0.8.3)
activestorage (= 7.0.8.3)
activesupport (= 7.0.8.3)
rails-dom-testing (~> 2.2)
rails-html-sanitizer (~> 1.6)
actiontext (7.1.4)
actionpack (= 7.1.4)
activerecord (= 7.1.4)
activestorage (= 7.1.4)
activesupport (= 7.1.4)
globalid (>= 0.6.0)
nokogiri (>= 1.8.5)
actionview (7.0.8.3)
activesupport (= 7.0.8.3)
actionview (7.1.4)
activesupport (= 7.1.4)
builder (~> 3.1)
erubi (~> 1.4)
rails-dom-testing (~> 2.0)
rails-html-sanitizer (~> 1.1, >= 1.2.0)
activejob (7.0.8.3)
activesupport (= 7.0.8.3)
erubi (~> 1.11)
rails-dom-testing (~> 2.2)
rails-html-sanitizer (~> 1.6)
activejob (7.1.4)
activesupport (= 7.1.4)
globalid (>= 0.3.6)
activemodel (7.0.8.3)
activesupport (= 7.0.8.3)
activerecord (7.0.8.3)
activemodel (= 7.0.8.3)
activesupport (= 7.0.8.3)
activestorage (7.0.8.3)
actionpack (= 7.0.8.3)
activejob (= 7.0.8.3)
activerecord (= 7.0.8.3)
activesupport (= 7.0.8.3)
activemodel (7.1.4)
activesupport (= 7.1.4)
activerecord (7.1.4)
activemodel (= 7.1.4)
activesupport (= 7.1.4)
timeout (>= 0.4.0)
activestorage (7.1.4)
actionpack (= 7.1.4)
activejob (= 7.1.4)
activerecord (= 7.1.4)
activesupport (= 7.1.4)
marcel (~> 1.0)
mini_mime (>= 1.1.0)
activesupport (7.0.8.3)
activesupport (7.1.4)
base64
bigdecimal
concurrent-ruby (~> 1.0, >= 1.0.2)
connection_pool (>= 2.2.5)
drb
i18n (>= 1.6, < 2)
minitest (>= 5.1)
mutex_m
tzinfo (~> 2.0)
addressable (2.8.7)
public_suffix (>= 2.0.2, < 7.0)
Expand Down Expand Up @@ -153,6 +162,7 @@ GEM
diffy (3.4.2)
docile (1.4.0)
domain_name (0.6.20240107)
drb (2.2.1)
erb_lint (0.6.0)
activesupport
better_html (>= 2.0.1)
Expand Down Expand Up @@ -242,10 +252,11 @@ GEM
govuk_personalisation (1.0.0)
plek (>= 1.9.0)
rails (>= 6, < 8)
govuk_publishing_components (43.3.0)
govuk_publishing_components (43.5.0)
govuk_app_config
govuk_personalisation (>= 0.7.0)
kramdown
ostruct
plek
rails (>= 6)
rouge
Expand Down Expand Up @@ -278,11 +289,15 @@ GEM
domain_name (~> 0.5)
i18n (1.14.5)
concurrent-ruby (~> 1.0)
inherited_resources (1.14.0)
inherited_resources (2.0.1)
actionpack (>= 6.0)
has_scope (>= 0.6)
railties (>= 6.0)
responders (>= 2)
io-console (0.7.2)
irb (1.14.0)
rdoc (>= 4.0.0)
reline (>= 0.4.2)
jmespath (1.6.2)
jquery-rails (4.6.0)
rails-dom-testing (>= 1, < 3)
Expand Down Expand Up @@ -357,8 +372,8 @@ GEM
railties (>= 3.1)
mongo (2.20.1)
bson (>= 4.14.1, < 6.0.0)
mongoid (8.1.2)
activemodel (>= 5.1, < 7.1, != 7.0.0)
mongoid (8.1.4)
activemodel (>= 5.1, < 7.2, != 7.0.0)
concurrent-ruby (>= 1.0.5, < 2.0)
mongo (>= 2.18.0, < 3.0.0)
ruby2_keywords (~> 0.0.5)
Expand All @@ -367,6 +382,7 @@ GEM
mousetrap-rails (1.4.6)
msgpack (1.7.2)
multi_xml (0.6.0)
mutex_m (0.2.0)
net-http (0.4.1)
uri
net-imap (0.4.14)
Expand Down Expand Up @@ -606,6 +622,7 @@ GEM
opentelemetry-semantic_conventions
opentelemetry-semantic_conventions (1.10.1)
opentelemetry-api (~> 1.0)
ostruct (0.6.0)
parallel (1.25.1)
parser (3.3.3.0)
ast (~> 2.4.1)
Expand All @@ -621,6 +638,8 @@ GEM
pry-byebug (3.10.1)
byebug (~> 11.0)
pry (>= 0.13, < 0.15)
psych (5.1.2)
stringio
public_suffix (6.0.1)
puma (6.4.3)
nio4r (~> 2.0)
Expand All @@ -631,22 +650,27 @@ GEM
rack (~> 2.2, >= 2.2.4)
rack-proxy (0.7.7)
rack
rack-session (1.0.2)
rack (< 3)
rack-test (2.1.0)
rack (>= 1.3)
rails (7.0.8.3)
actioncable (= 7.0.8.3)
actionmailbox (= 7.0.8.3)
actionmailer (= 7.0.8.3)
actionpack (= 7.0.8.3)
actiontext (= 7.0.8.3)
actionview (= 7.0.8.3)
activejob (= 7.0.8.3)
activemodel (= 7.0.8.3)
activerecord (= 7.0.8.3)
activestorage (= 7.0.8.3)
activesupport (= 7.0.8.3)
rackup (1.0.0)
rack (< 3)
webrick
rails (7.1.4)
actioncable (= 7.1.4)
actionmailbox (= 7.1.4)
actionmailer (= 7.1.4)
actionpack (= 7.1.4)
actiontext (= 7.1.4)
actionview (= 7.1.4)
activejob (= 7.1.4)
activemodel (= 7.1.4)
activerecord (= 7.1.4)
activestorage (= 7.1.4)
activesupport (= 7.1.4)
bundler (>= 1.15.0)
railties (= 7.0.8.3)
railties (= 7.1.4)
rails-controller-testing (1.0.5)
actionpack (>= 5.0.1.rc1)
actionview (>= 5.0.1.rc1)
Expand All @@ -662,22 +686,27 @@ GEM
actionview (> 3.1)
activesupport (> 3.1)
railties (> 3.1)
railties (7.0.8.3)
actionpack (= 7.0.8.3)
activesupport (= 7.0.8.3)
method_source
railties (7.1.4)
actionpack (= 7.1.4)
activesupport (= 7.1.4)
irb
rackup (>= 1.0.0)
rake (>= 12.2)
thor (~> 1.0)
zeitwerk (~> 2.5)
thor (~> 1.0, >= 1.2.2)
zeitwerk (~> 2.6)
rainbow (3.1.1)
rake (13.2.1)
rdoc (6.7.0)
psych (>= 4.0.0)
redis (4.8.1)
redis-namespace (1.11.0)
redis (>= 4)
regexp_parser (2.9.2)
reline (0.5.10)
io-console (~> 0.5)
request_store (1.7.0)
rack (>= 1.4)
responders (3.1.0)
responders (3.1.1)
actionpack (>= 5.2)
railties (>= 5.2)
rest-client (2.1.0)
Expand Down Expand Up @@ -782,16 +811,17 @@ GEM
activesupport (>= 6.1)
sprockets (>= 3.0.0)
state_machines (0.6.0)
state_machines-activemodel (0.8.0)
activemodel (>= 5.1)
state_machines (>= 0.5.0)
state_machines-activemodel (0.9.0)
activemodel (>= 6.0)
state_machines (>= 0.6.0)
state_machines-graphviz (0.0.2)
ruby-graphviz
state_machines
state_machines-mongoid (0.2.0)
mongoid (>= 4.0.0)
state_machines-activemodel (>= 0.5.0)
statsd-ruby (1.5.0)
stringio (3.1.1)
strip_attributes (1.13.0)
activemodel (>= 3.0, < 8.0)
strscan (3.1.0)
Expand Down Expand Up @@ -868,7 +898,7 @@ DEPENDENCIES
mocha
momentjs-rails
mongo
mongoid
mongoid (= 8.1.4)
mongoid-sadstory
mousetrap-rails
nested_form!
Expand All @@ -877,14 +907,15 @@ DEPENDENCIES
prometheus-client
pry-byebug
rack
rails (= 7.0.8.3)
rails (= 7.1.4)
rails-controller-testing
rails_autolink
rest-client
rubocop-govuk
select2-rails (~> 3.5.9)
sentry-sidekiq
shoulda
sidekiq (< 7)
simplecov
sprockets-rails
state_machines
Expand Down
9 changes: 7 additions & 2 deletions app/controllers/homepage_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,8 @@ def edit
end

def update
@latest_popular_links.link_items = remove_leading_and_trailing_url_spaces(params[:popular_links].values)
create_params = permitted_params
@latest_popular_links.link_items = remove_leading_and_trailing_url_spaces(create_params[:popular_links].values)
@latest_popular_links.save_draft

flash[:success] = "Popular links draft saved.".html_safe
Expand Down Expand Up @@ -72,6 +73,10 @@ def confirm_destroy

private

def permitted_params
params.permit(popular_links: %i[title url])
end

def cannot_delete_published_error_message
"Can't delete an already published edition. Please create a new edition to make changes.".html_safe
end
Expand Down Expand Up @@ -108,7 +113,7 @@ def remove_leading_and_trailing_url_spaces(links)
link_items = []
links.each do |link|
link[:url] = link[:url].strip
link_items << link
link_items << link.to_h
end
link_items
end
Expand Down
2 changes: 1 addition & 1 deletion bin/setup
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ require "fileutils"
APP_ROOT = File.expand_path("..", __dir__)

def system!(*args)
system(*args) || abort("\n== Command #{args} failed ==")
system(*args, exception: true)
end

FileUtils.chdir APP_ROOT do
Expand Down
Loading
Loading