Skip to content

Commit

Permalink
Merge pull request #991 from alphagov/upgrade-to-rails-7-2
Browse files Browse the repository at this point in the history
Upgrade to Rails 7.2
  • Loading branch information
pixeltrix authored Sep 4, 2024
2 parents 3e476f1 + 657630f commit f534ae1
Show file tree
Hide file tree
Showing 15 changed files with 140 additions and 121 deletions.
2 changes: 1 addition & 1 deletion Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ source 'https://rubygems.org'
# Load environment variables
gem 'dotenv', require: 'dotenv/load'

gem 'rails', '7.1.4'
gem 'rails', '7.2.1'

gem 'rake'
gem 'pg'
Expand Down
141 changes: 69 additions & 72 deletions Gemfile.lock
Original file line number Diff line number Diff line change
@@ -1,80 +1,76 @@
GEM
remote: https://rubygems.org/
specs:
actioncable (7.1.4)
actionpack (= 7.1.4)
activesupport (= 7.1.4)
actioncable (7.2.1)
actionpack (= 7.2.1)
activesupport (= 7.2.1)
nio4r (~> 2.0)
websocket-driver (>= 0.6.1)
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.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
actionmailbox (7.2.1)
actionpack (= 7.2.1)
activejob (= 7.2.1)
activerecord (= 7.2.1)
activestorage (= 7.2.1)
activesupport (= 7.2.1)
mail (>= 2.8.0)
actionmailer (7.2.1)
actionpack (= 7.2.1)
actionview (= 7.2.1)
activejob (= 7.2.1)
activesupport (= 7.2.1)
mail (>= 2.8.0)
rails-dom-testing (~> 2.2)
actionpack (7.1.4)
actionview (= 7.1.4)
activesupport (= 7.1.4)
actionpack (7.2.1)
actionview (= 7.2.1)
activesupport (= 7.2.1)
nokogiri (>= 1.8.5)
racc
rack (>= 2.2.4)
rack (>= 2.2.4, < 3.2)
rack-session (>= 1.0.1)
rack-test (>= 0.6.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)
useragent (~> 0.16)
actiontext (7.2.1)
actionpack (= 7.2.1)
activerecord (= 7.2.1)
activestorage (= 7.2.1)
activesupport (= 7.2.1)
globalid (>= 0.6.0)
nokogiri (>= 1.8.5)
actionview (7.1.4)
activesupport (= 7.1.4)
actionview (7.2.1)
activesupport (= 7.2.1)
builder (~> 3.1)
erubi (~> 1.11)
rails-dom-testing (~> 2.2)
rails-html-sanitizer (~> 1.6)
activejob (7.1.4)
activesupport (= 7.1.4)
activejob (7.2.1)
activesupport (= 7.2.1)
globalid (>= 0.3.6)
activemodel (7.1.4)
activesupport (= 7.1.4)
activerecord (7.1.4)
activemodel (= 7.1.4)
activesupport (= 7.1.4)
activemodel (7.2.1)
activesupport (= 7.2.1)
activerecord (7.2.1)
activemodel (= 7.2.1)
activesupport (= 7.2.1)
timeout (>= 0.4.0)
activestorage (7.1.4)
actionpack (= 7.1.4)
activejob (= 7.1.4)
activerecord (= 7.1.4)
activesupport (= 7.1.4)
activestorage (7.2.1)
actionpack (= 7.2.1)
activejob (= 7.2.1)
activerecord (= 7.2.1)
activesupport (= 7.2.1)
marcel (~> 1.0)
activesupport (7.1.4)
activesupport (7.2.1)
base64
bigdecimal
concurrent-ruby (~> 1.0, >= 1.0.2)
concurrent-ruby (~> 1.0, >= 1.3.1)
connection_pool (>= 2.2.5)
drb
i18n (>= 1.6, < 2)
logger (>= 1.4.2)
minitest (>= 5.1)
mutex_m
tzinfo (~> 2.0)
securerandom (>= 0.3)
tzinfo (~> 2.0, >= 2.0.5)
addressable (2.8.7)
public_suffix (>= 2.0.2, < 7.0)
appsignal (3.13.1)
Expand Down Expand Up @@ -278,7 +274,6 @@ GEM
minitest (5.25.1)
multi_test (1.1.0)
multipart-post (2.4.0)
mutex_m (0.2.0)
net-http-persistent (4.0.2)
connection_pool (~> 2.2)
net-imap (0.4.15)
Expand Down Expand Up @@ -331,20 +326,20 @@ GEM
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)
rails (7.2.1)
actioncable (= 7.2.1)
actionmailbox (= 7.2.1)
actionmailer (= 7.2.1)
actionpack (= 7.2.1)
actiontext (= 7.2.1)
actionview (= 7.2.1)
activejob (= 7.2.1)
activemodel (= 7.2.1)
activerecord (= 7.2.1)
activestorage (= 7.2.1)
activesupport (= 7.2.1)
bundler (>= 1.15.0)
railties (= 7.1.4)
railties (= 7.2.1)
rails-controller-testing (1.0.5)
actionpack (>= 5.0.1.rc1)
actionview (>= 5.0.1.rc1)
Expand All @@ -356,10 +351,10 @@ GEM
rails-html-sanitizer (1.6.0)
loofah (~> 2.21)
nokogiri (~> 1.14)
railties (7.1.4)
actionpack (= 7.1.4)
activesupport (= 7.1.4)
irb
railties (7.2.1)
actionpack (= 7.2.1)
activesupport (= 7.2.1)
irb (~> 1.13)
rackup (>= 1.0.0)
rake (>= 12.2)
thor (~> 1.0, >= 1.2.2)
Expand Down Expand Up @@ -389,10 +384,10 @@ GEM
rspec-mocks (3.13.1)
diff-lcs (>= 1.2.0, < 2.0)
rspec-support (~> 3.13.0)
rspec-rails (6.1.5)
actionpack (>= 6.1)
activesupport (>= 6.1)
railties (>= 6.1)
rspec-rails (7.0.1)
actionpack (>= 7.0)
activesupport (>= 7.0)
railties (>= 7.0)
rspec-core (~> 3.13)
rspec-expectations (~> 3.13)
rspec-mocks (~> 3.13)
Expand Down Expand Up @@ -420,6 +415,7 @@ GEM
scrypt (3.0.8)
ffi-compiler (>= 1.0, < 2.0)
rake (>= 9, < 14)
securerandom (0.3.1)
selenium-webdriver (4.24.0)
base64 (~> 0.2)
logger (~> 1.4)
Expand Down Expand Up @@ -456,6 +452,7 @@ GEM
timeout (0.4.1)
tzinfo (2.0.6)
concurrent-ruby (~> 1.0)
useragent (0.16.10)
warden (1.2.9)
rack (>= 2.0.9)
webmock (3.23.1)
Expand Down Expand Up @@ -519,7 +516,7 @@ DEPENDENCIES
pg
pry
puma
rails (= 7.1.4)
rails (= 7.2.1)
rails-controller-testing
rake
redcarpet
Expand Down
2 changes: 1 addition & 1 deletion app/models/archived/signature.rb
Original file line number Diff line number Diff line change
Expand Up @@ -203,7 +203,7 @@ def email_index
end

def ip_index
Arel.sql("inet(ip_address) <<= inet(:ip)")
Arel.sql("inet(ip_address) <<= inet((:ip)::text)")
end

def ip_search?(query)
Expand Down
2 changes: 1 addition & 1 deletion app/models/invalidation.rb
Original file line number Diff line number Diff line change
Expand Up @@ -277,7 +277,7 @@ def email_index
end

def ip_index
Arel.sql("inet(ip_address) <<= inet(:ip)")
Arel.sql("inet(ip_address) <<= inet((:ip)::text)")
end

def normalize_email(email)
Expand Down
2 changes: 1 addition & 1 deletion app/models/signature.rb
Original file line number Diff line number Diff line change
Expand Up @@ -464,7 +464,7 @@ def email_index
end

def ip_index
Arel.sql("inet(ip_address) <<= inet(:ip)")
Arel.sql("inet(ip_address) <<= inet((:ip)::text)")
end

def count_star
Expand Down
27 changes: 27 additions & 0 deletions bin/brakeman
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
#!/usr/bin/env ruby
# frozen_string_literal: true

#
# This file was generated by Bundler.
#
# The application 'brakeman' is installed as part of a gem, and
# this file is here to facilitate running it.
#

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

bundle_binstub = File.expand_path("bundle", __dir__)

if File.file?(bundle_binstub)
if File.read(bundle_binstub, 300) =~ /This file was generated by Bundler/
load(bundle_binstub)
else
abort("Your `bin/bundle` was not generated by Bundler, so this binstub cannot run.
Replace `bin/bundle` by running `bundle binstubs bundler --force`, then run this command again.")
end
end

require "rubygems"
require "bundler/setup"

load Gem.bin_path("brakeman", "brakeman")
1 change: 0 additions & 1 deletion bin/setup
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
#!/usr/bin/env ruby
require "fileutils"

# path to your application root.
APP_ROOT = File.expand_path("..", __dir__)

def system!(*args)
Expand Down
6 changes: 3 additions & 3 deletions config/application.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@
require_relative "../lib/quiet_logger"
require_relative "../lib/reject_bad_requests"

require "rails"
require_relative "boot"

require "rails"
# Pick the frameworks you want:
require "active_model/railtie"
require "active_job/railtie"
Expand All @@ -22,12 +22,12 @@
module Epets
class Application < Rails::Application
# Initialize configuration defaults for originally generated Rails version.
config.load_defaults 7.1
config.load_defaults 7.2

# Please, add to the `ignore` list any other `lib` subdirectories that do
# not contain `.rb` files, or that should not be reloaded or eager loaded.
# Common ones are `templates`, `generators`, or `middleware`, for example.
config.autoload_lib(ignore: %w(assets tasks))
config.autoload_lib(ignore: %w[assets tasks])

# Configuration for the application, engines, and railties goes here.
#
Expand Down
Loading

0 comments on commit f534ae1

Please sign in to comment.