Skip to content

Commit

Permalink
Bump to rails version 8.0.0
Browse files Browse the repository at this point in the history
  • Loading branch information
gms-gs committed Nov 26, 2024
1 parent 3e1553b commit f0e7385
Show file tree
Hide file tree
Showing 12 changed files with 120 additions and 128 deletions.
7 changes: 2 additions & 5 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ git_source(:github) { |repo| "https://github.com/#{repo}.git" }
ruby file: '.ruby-version'

# Bundle edge Rails instead: gem 'rails', github: 'rails/rails'
gem 'rails', '7.2.2'
gem 'rails', '8.0.0'

# Use PostgreSQL as the database for Active Record
gem 'pg'
Expand All @@ -20,9 +20,6 @@ gem 'puma', '~> 6.5'
# Reduces boot times through caching; required in config/boot.rb
gem 'bootsnap', '>= 1.1.0', require: false

# Canonical meta tag
gem 'canonical-rails'

# Decorate logic to keep it out of the views and helper methods
gem 'draper'

Expand Down Expand Up @@ -166,7 +163,7 @@ group :development, :test do
gem 'amazing_print'

# Help eliminate N+1 queries
gem 'bullet'
gem 'bullet', require: false

# Call 'byebug' anywhere in the code to stop execution and get a debugger console
gem 'byebug', platforms: %i[mri mingw x64_mingw]
Expand Down
125 changes: 61 additions & 64 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -54,46 +54,45 @@ GEM
specs:
aasm (5.5.0)
concurrent-ruby (~> 1.0)
actioncable (7.2.2)
actionpack (= 7.2.2)
activesupport (= 7.2.2)
actioncable (8.0.0)
actionpack (= 8.0.0)
activesupport (= 8.0.0)
nio4r (~> 2.0)
websocket-driver (>= 0.6.1)
zeitwerk (~> 2.6)
actionmailbox (7.2.2)
actionpack (= 7.2.2)
activejob (= 7.2.2)
activerecord (= 7.2.2)
activestorage (= 7.2.2)
activesupport (= 7.2.2)
actionmailbox (8.0.0)
actionpack (= 8.0.0)
activejob (= 8.0.0)
activerecord (= 8.0.0)
activestorage (= 8.0.0)
activesupport (= 8.0.0)
mail (>= 2.8.0)
actionmailer (7.2.2)
actionpack (= 7.2.2)
actionview (= 7.2.2)
activejob (= 7.2.2)
activesupport (= 7.2.2)
actionmailer (8.0.0)
actionpack (= 8.0.0)
actionview (= 8.0.0)
activejob (= 8.0.0)
activesupport (= 8.0.0)
mail (>= 2.8.0)
rails-dom-testing (~> 2.2)
actionpack (7.2.2)
actionview (= 7.2.2)
activesupport (= 7.2.2)
actionpack (8.0.0)
actionview (= 8.0.0)
activesupport (= 8.0.0)
nokogiri (>= 1.8.5)
racc
rack (>= 2.2.4, < 3.2)
rack (>= 2.2.4)
rack-session (>= 1.0.1)
rack-test (>= 0.6.3)
rails-dom-testing (~> 2.2)
rails-html-sanitizer (~> 1.6)
useragent (~> 0.16)
actiontext (7.2.2)
actionpack (= 7.2.2)
activerecord (= 7.2.2)
activestorage (= 7.2.2)
activesupport (= 7.2.2)
actiontext (8.0.0)
actionpack (= 8.0.0)
activerecord (= 8.0.0)
activestorage (= 8.0.0)
activesupport (= 8.0.0)
globalid (>= 0.6.0)
nokogiri (>= 1.8.5)
actionview (7.2.2)
activesupport (= 7.2.2)
actionview (8.0.0)
activesupport (= 8.0.0)
builder (~> 3.1)
erubi (~> 1.11)
rails-dom-testing (~> 2.2)
Expand All @@ -103,26 +102,26 @@ GEM
activemodel (>= 4.1)
case_transform (>= 0.2)
jsonapi-renderer (>= 0.1.1.beta1, < 0.3)
activejob (7.2.2)
activesupport (= 7.2.2)
activejob (8.0.0)
activesupport (= 8.0.0)
globalid (>= 0.3.6)
activemodel (7.2.2)
activesupport (= 7.2.2)
activemodel (8.0.0)
activesupport (= 8.0.0)
activemodel-serializers-xml (1.0.2)
activemodel (> 5.x)
activesupport (> 5.x)
builder (~> 3.1)
activerecord (7.2.2)
activemodel (= 7.2.2)
activesupport (= 7.2.2)
activerecord (8.0.0)
activemodel (= 8.0.0)
activesupport (= 8.0.0)
timeout (>= 0.4.0)
activestorage (7.2.2)
actionpack (= 7.2.2)
activejob (= 7.2.2)
activerecord (= 7.2.2)
activesupport (= 7.2.2)
activestorage (8.0.0)
actionpack (= 8.0.0)
activejob (= 8.0.0)
activerecord (= 8.0.0)
activesupport (= 8.0.0)
marcel (~> 1.0)
activesupport (7.2.2)
activesupport (8.0.0)
base64
benchmark (>= 0.3)
bigdecimal
Expand All @@ -134,16 +133,17 @@ GEM
minitest (>= 5.1)
securerandom (>= 0.3)
tzinfo (~> 2.0, >= 2.0.5)
uri (>= 0.13.1)
addressable (2.8.7)
public_suffix (>= 2.0.2, < 7.0)
aes_key_wrap (1.1.0)
amazing_print (1.6.0)
ast (2.4.2)
attr_extras (7.1.0)
attr_required (1.0.2)
audited (5.7.0)
activerecord (>= 5.2, < 8.0)
activesupport (>= 5.2, < 8.0)
audited (5.8.0)
activerecord (>= 5.2, < 8.2)
activesupport (>= 5.2, < 8.2)
awesome_print (1.9.2)
base64 (0.2.0)
benchmark (0.4.0)
Expand Down Expand Up @@ -177,8 +177,6 @@ GEM
activesupport (>= 3.0.0)
uniform_notifier (~> 1.11)
byebug (11.1.3)
canonical-rails (0.2.16)
actionview (>= 4.1, < 7.3)
capybara (3.40.0)
addressable
matrix
Expand Down Expand Up @@ -519,20 +517,20 @@ GEM
rackup (1.0.1)
rack (< 3)
webrick
rails (7.2.2)
actioncable (= 7.2.2)
actionmailbox (= 7.2.2)
actionmailer (= 7.2.2)
actionpack (= 7.2.2)
actiontext (= 7.2.2)
actionview (= 7.2.2)
activejob (= 7.2.2)
activemodel (= 7.2.2)
activerecord (= 7.2.2)
activestorage (= 7.2.2)
activesupport (= 7.2.2)
rails (8.0.0)
actioncable (= 8.0.0)
actionmailbox (= 8.0.0)
actionmailer (= 8.0.0)
actionpack (= 8.0.0)
actiontext (= 8.0.0)
actionview (= 8.0.0)
activejob (= 8.0.0)
activemodel (= 8.0.0)
activerecord (= 8.0.0)
activestorage (= 8.0.0)
activesupport (= 8.0.0)
bundler (>= 1.15.0)
railties (= 7.2.2)
railties (= 8.0.0)
rails-controller-testing (1.0.5)
actionpack (>= 5.0.1.rc1)
actionview (>= 5.0.1.rc1)
Expand All @@ -553,9 +551,9 @@ GEM
rack
railties (>= 5.1)
semantic_logger (~> 4.16)
railties (7.2.2)
actionpack (= 7.2.2)
activesupport (= 7.2.2)
railties (8.0.0)
actionpack (= 8.0.0)
activesupport (= 8.0.0)
irb (~> 1.13)
rackup (>= 1.0.0)
rake (>= 12.2)
Expand Down Expand Up @@ -639,8 +637,8 @@ GEM
ruby2_keywords (0.0.5)
rubypants (0.7.1)
safely_block (0.4.1)
schema_to_scaffold (0.8.2)
activesupport (~> 7)
schema_to_scaffold (0.8.0)
activesupport (>= 3.2.1)
securerandom (0.3.2)
semantic_logger (4.16.0)
concurrent-ruby (~> 1.0)
Expand Down Expand Up @@ -756,7 +754,6 @@ DEPENDENCIES
brakeman
bullet
byebug
canonical-rails
capybara (>= 2.15)
cloudfront-rails
colorize
Expand Down Expand Up @@ -812,7 +809,7 @@ DEPENDENCIES
puma (~> 6.5)
pundit
rack-cors
rails (= 7.2.2)
rails (= 8.0.0)
rails-controller-testing
rails-erd
rails_semantic_logger
Expand Down
5 changes: 4 additions & 1 deletion app/views/layouts/application.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,10 @@
<title><%= yield :page_title %> - Publish teacher training courses - GOV.UK</title>
<%= csrf_meta_tags %>
<%= csp_meta_tag %>
<%= canonical_tag %>

<% url = URI(request.url.split("?").first) %>
<%= tag.link(href: url.path.ends_with?("/") ? url.to_s : "#{url}/", rel: "canonical") %>
<%= tag.meta(property: "og:url", content: url.path.ends_with?("/") ? url.to_s : "#{url}/") %>

<%= tag.meta(name: "viewport", content: "width=device-width, initial-scale=1") %>
<%= tag.meta(property: "og:image", content: image_path("govuk-opengraph-image.png")) %>
Expand Down
5 changes: 4 additions & 1 deletion app/views/layouts/find_layout.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,10 @@
<title><%= yield :page_title %> - <%= t("service_name.find") %> - GOV.UK</title>
<%= csrf_meta_tags %>
<%= csp_meta_tag %>
<%= canonical_tag %>

<% url = URI(request.url.split("?").first) %>
<%= tag.link(href: url.path.ends_with?("/") ? url.to_s : "#{url}/", rel: "canonical") %>
<%= tag.meta(property: "og:url", content: url.path.ends_with?("/") ? url.to_s : "#{url}/") %>

<%= tag.meta(name: "viewport", content: "width=device-width, initial-scale=1") %>
<%= tag.meta(property: "og:image", content: image_path("govuk-opengraph-image.png")) %>
Expand Down
11 changes: 2 additions & 9 deletions bin/dev
Original file line number Diff line number Diff line change
@@ -1,9 +1,2 @@
#!/usr/bin/env bash

if ! command -v foreman &> /dev/null
then
echo "Installing foreman..."
gem install foreman
fi

foreman start -f Procfile.dev "$@"
#!/usr/bin/env ruby
exec "./bin/rails", "server", *ARGV
20 changes: 10 additions & 10 deletions bin/setup
Original file line number Diff line number Diff line change
@@ -1,9 +1,7 @@
#!/usr/bin/env ruby
require "fileutils"

# path to your application root.
APP_ROOT = File.expand_path("..", __dir__)
APP_NAME = "manage-courses-backend"

def system!(*args)
system(*args, exception: true)
Expand All @@ -15,20 +13,22 @@ FileUtils.chdir APP_ROOT do
# Add necessary setup steps to this file.

puts "== Installing dependencies =="
system("yarn install")
system! "gem install bundler --conservative"
system("bundle check") || system!("bundle install")

# puts "\n== Copying sample files =="
# unless File.exist?("config/database.yml")
# FileUtils.cp "config/database.yml.sample", "config/database.yml"
# end

puts "\n== Preparing database =="
system! "bin/rails db:prepare"

puts "\n== Removing old logs and tempfiles =="
system! "bin/rails log:clear tmp:clear"

puts "\n== Restarting application server =="
system! "bin/rails restart"

# puts "\n== Configuring puma-dev =="
# system "ln -nfs #{APP_ROOT} ~/.puma-dev/#{APP_NAME}"
# system "curl -Is https://#{APP_NAME}.test/up | head -n 1"
unless ARGV.include?("--skip-server")
puts "\n== Starting development server =="
STDOUT.flush # flush the output before exec(2) so that it displays
exec "bin/dev"
end
end
5 changes: 5 additions & 0 deletions bin/thrust
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
#!/usr/bin/env ruby
require "rubygems"
require "bundler/setup"

load Gem.bin_path("thruster", "thrust")
2 changes: 0 additions & 2 deletions config/boot.rb
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
# frozen_string_literal: true

ENV["BUNDLE_GEMFILE"] ||= File.expand_path("../Gemfile", __dir__)

require "bundler/setup" # Set up gems listed in the Gemfile.
Expand Down
2 changes: 0 additions & 2 deletions config/environment.rb
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
# frozen_string_literal: true

# Load the Rails application.
require_relative "application"

Expand Down
30 changes: 0 additions & 30 deletions config/initializers/canonical_rails.rb

This file was deleted.

6 changes: 2 additions & 4 deletions config/initializers/filter_parameter_logging.rb
Original file line number Diff line number Diff line change
@@ -1,10 +1,8 @@
# frozen_string_literal: true

# Be sure to restart your server when you modify this file.

# Configure parameters to be partially matched (e.g. passw matches password) and filtered from the log file.
# Use this to limit dissemination of sensitive information.
# See the ActiveSupport::ParameterFilter documentation for supported notations and behaviors.
Rails.application.config.filter_parameters += %i[
passw email secret token _key crypt salt certificate otp ssn password email first_name last_name
Rails.application.config.filter_parameters += [
:passw, :email, :secret, :token, :_key, :crypt, :salt, :certificate, :otp, :ssn
]
Loading

0 comments on commit f0e7385

Please sign in to comment.