Skip to content

Commit 074290d

Browse files
Merge pull request #879 from alphagov/rails-upgrade-v3
Upgrade to rails 7.1.2
2 parents 687d468 + 6f3ef6e commit 074290d

23 files changed

+363
-103
lines changed

app/models/publishing_api_manual.rb

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,4 @@
11
require "active_model"
2-
require "struct_with_rendered_markdown"
3-
require "valid_slug/pattern"
42

53
class PublishingAPIManual
64
include ActiveModel::Validations
@@ -122,6 +120,6 @@ def incoming_manual_is_valid
122120
end
123121

124122
def only_known_hmrc_manual_slugs?
125-
!HMRCManualsAPI::Application.config.allow_unknown_hmrc_manual_slugs
123+
!HmrcManualsApi::Application.config.allow_unknown_hmrc_manual_slugs
126124
end
127125
end

app/models/publishing_api_redirected_manual.rb

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
require "active_model"
2-
require "valid_slug/pattern"
32

43
class PublishingAPIRedirectedManual
54
include ActiveModel::Validations

app/models/publishing_api_redirected_section.rb

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
require "active_model"
2-
require "valid_slug/pattern"
32

43
class PublishingAPIRedirectedSection
54
include ActiveModel::Validations

app/models/publishing_api_removed_manual.rb

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
require "active_model"
2-
require "valid_slug/pattern"
32

43
class PublishingAPIRemovedManual
54
include ActiveModel::Validations

app/models/publishing_api_removed_section.rb

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
require "active_model"
2-
require "valid_slug/pattern"
32

43
class PublishingAPIRemovedSection
54
include ActiveModel::Validations

app/models/publishing_api_section.rb

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,4 @@
11
require "active_model"
2-
require "struct_with_rendered_markdown"
3-
require "valid_slug/pattern"
42

53
class PublishingAPISection
64
include ActiveModel::Validations
@@ -128,6 +126,6 @@ def section_slug_matches_section_id
128126
end
129127

130128
def only_known_hmrc_manual_slugs?
131-
!HMRCManualsAPI::Application.config.allow_unknown_hmrc_manual_slugs
129+
!HmrcManualsApi::Application.config.allow_unknown_hmrc_manual_slugs
132130
end
133131
end

app/validators/no_dangerous_html_in_text_fields_validator.rb

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
require "govspeak/html_validator"
2-
require "structured_data"
32

43
class NoDangerousHTMLInTextFieldsValidator < ActiveModel::EachValidator
54
ALLOWED_IMAGE_HOSTS = [

bin/setup

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ require "fileutils"
55
APP_ROOT = File.expand_path("..", __dir__)
66

77
def system!(*args)
8-
system(*args) || abort("\n== Command #{args} failed ==")
8+
system(*args, exception: true)
99
end
1010

1111
FileUtils.chdir APP_ROOT do
@@ -17,9 +17,6 @@ FileUtils.chdir APP_ROOT do
1717
system! "gem install bundler --conservative"
1818
system("bundle check") || system!("bundle install")
1919

20-
puts "\n== Preparing database =="
21-
system! "bin/rails db:setup"
22-
2320
puts "\n== Removing old logs and tempfiles =="
2421
system! "bin/rails log:clear tmp:clear"
2522

config/application.rb

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,11 +18,16 @@
1818
# you've limited to :test, :development, or :production.
1919
Bundler.require(*Rails.groups)
2020

21-
module HMRCManualsAPI
21+
module HmrcManualsApi
2222
class Application < Rails::Application
2323
# Initialize configuration defaults for originally generated Rails version.
2424
config.load_defaults 7.0
2525

26+
# Please, add to the `ignore` list any other `lib` subdirectories that do
27+
# not contain `.rb` files, or that should not be reloaded or eager loaded.
28+
# Common ones are `templates`, `generators`, or `middleware`, for example.
29+
config.autoload_lib(ignore: %w[assets tasks])
30+
2631
# Configuration for the application, engines, and railties goes here.
2732
#
2833
# These settings can be overridden in specific environments using the files

config/environments/development.rb

Lines changed: 5 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
# In the development environment your application's code is reloaded any time
77
# it changes. This slows down response time but is perfect for development
88
# since you don't have to restart the web server when you make code changes.
9-
config.cache_classes = false
9+
config.enable_reloading = true
1010

1111
# Do not eager load code on boot.
1212
config.eager_load = false
@@ -47,21 +47,17 @@
4747
# Tell Active Support which deprecation messages to disallow.
4848
config.active_support.disallowed_deprecation_warnings = []
4949

50-
# Suppress logger output for asset requests.
51-
# config.assets.quiet = true
50+
# Highlight code that enqueued background job in logs.
51+
config.active_job.verbose_enqueue_logs = true
5252

5353
# Raises error for missing translations.
5454
# config.i18n.raise_on_missing_translations = true
5555

5656
# Annotate rendered view with file names.
5757
# config.action_view.annotate_rendered_view_with_filenames = true
5858

59-
# Use an evented file watcher to asynchronously detect changes in source code,
60-
# routes, locales, etc. This feature depends on the listen gem.
61-
config.file_watcher = ActiveSupport::EventedFileUpdateChecker
62-
63-
# Uncomment if you wish to allow Action Cable access from any origin.
64-
# config.action_cable.disable_request_forgery_protection = true
59+
# Raise error when a before_action's only/except options reference missing actions
60+
config.action_controller.raise_on_missing_callback_actions = true
6561

6662
# Allow requests for all domains e.g. <app>.dev.gov.uk
6763
config.hosts.clear

0 commit comments

Comments
 (0)