Skip to content

Commit

Permalink
feat: Upgrade to Rails 8.0
Browse files Browse the repository at this point in the history
  • Loading branch information
jgraichen committed Nov 25, 2024
1 parent 2acb2c3 commit e14002e
Show file tree
Hide file tree
Showing 21 changed files with 758 additions and 384 deletions.
4 changes: 2 additions & 2 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,10 @@ gem "config", "~> 5.5"
gem "dry-validation", "~> 1.10"
gem "forked", "~> 0.1.2"
gem "puma", "~> 6.4"
gem "rails", "~> 7.2.0"
gem "rails", "~> 8.0.0"
gem "unicorn", "~> 6.0"

gem "active_record_upsert", github: "jesjos/active_record_upsert", ref: "c3e07ae"
gem "active_record_upsert", github: "jesjos/active_record_upsert", ref: "5b2769eb5ec089665e5a099c151401d5ba14c104"

gem "bulk_insert", "~> 1.8"
gem "hutch", "~> 1.1"
Expand Down
142 changes: 72 additions & 70 deletions Gemfile.lock
Original file line number Diff line number Diff line change
@@ -1,79 +1,78 @@
GIT
remote: https://github.com/jesjos/active_record_upsert.git
revision: c3e07aecf28d6a81a06fcada4710b103dfca823b
ref: c3e07ae
revision: 5b2769eb5ec089665e5a099c151401d5ba14c104
ref: 5b2769eb5ec089665e5a099c151401d5ba14c104
specs:
active_record_upsert (0.11.2)
activerecord (>= 5.2, < 8.0)
activerecord (>= 5.2, < 8.1)
pg (>= 0.18, < 2.0)

GEM
remote: https://rubygems.org/
specs:
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)
rails-html-sanitizer (~> 1.6)
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.3)
activemodel (>= 5.0.0.a)
activesupport (>= 5.0.0.a)
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 @@ -85,6 +84,7 @@ 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)
amq-protocol (2.3.2)
Expand Down Expand Up @@ -119,7 +119,7 @@ GEM
ostruct
connection_pool (2.4.1)
crass (1.0.6)
date (3.3.4)
date (3.4.0)
deep_merge (1.2.2)
diff-lcs (1.5.1)
draper (4.0.2)
Expand All @@ -133,8 +133,9 @@ GEM
dry-configurable (1.2.0)
dry-core (~> 1.0, < 2)
zeitwerk (~> 2.6)
dry-core (1.0.1)
dry-core (1.0.2)
concurrent-ruby (~> 1.0)
logger
zeitwerk (~> 2.6)
dry-inflector (1.1.0)
dry-initializer (3.1.1)
Expand Down Expand Up @@ -215,13 +216,13 @@ GEM
matrix (0.4.2)
method_source (1.1.0)
mini_mime (1.1.5)
mini_portile2 (2.8.7)
minitest (5.25.1)
mini_portile2 (2.8.8)
minitest (5.25.2)
mnemosyne-ruby (2.0.0)
activesupport (>= 6.1)
bunny
multi_json (1.15.0)
net-imap (0.5.0)
net-imap (0.5.1)
date
net-protocol
net-pop (0.1.2)
Expand All @@ -239,7 +240,7 @@ GEM
oj (3.16.7)
bigdecimal (>= 3.0)
ostruct (>= 0.2)
ostruct (0.6.0)
ostruct (0.6.1)
parallel (1.26.3)
parser (3.3.6.0)
ast (~> 2.4.1)
Expand All @@ -262,22 +263,22 @@ GEM
rack (>= 3.0.0)
rack-test (2.1.0)
rack (>= 1.3)
rackup (2.2.0)
rackup (2.2.1)
rack (>= 3)
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-assets-manifest (3.0.1)
activesupport (> 4.2)
railties (> 4.2)
Expand All @@ -288,12 +289,12 @@ GEM
rails-html-sanitizer (1.6.0)
loofah (~> 2.21)
nokogiri (~> 1.14)
rails-rfc6570 (3.2.0)
actionpack (>= 4.2, < 8.0)
rails-rfc6570 (3.3.0)
actionpack (>= 4.2, < 8.1)
addressable (~> 2.3)
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 All @@ -306,7 +307,7 @@ GEM
rb-inotify (0.11.1)
ffi (~> 1.0)
rbtree (0.4.6)
rdoc (6.7.0)
rdoc (6.8.1)
psych (>= 4.0.0)
regexp_parser (2.9.2)
reline (0.5.11)
Expand Down Expand Up @@ -395,13 +396,14 @@ GEM
thor (1.3.2)
tilt (2.4.0)
timecop (0.9.10)
timeout (0.4.1)
timeout (0.4.2)
tzinfo (2.0.6)
concurrent-ruby (~> 1.0)
unicode-display_width (2.6.0)
unicorn (6.1.0)
kgio (~> 2.6)
raindrops (~> 0.7)
uri (1.0.2)
useragent (0.16.10)
uuid4 (1.4.0)
base62-rb (~> 0.3.0)
Expand Down Expand Up @@ -445,7 +447,7 @@ DEPENDENCIES
pry
pry-byebug
puma (~> 6.4)
rails (~> 7.2.0)
rails (~> 8.0.0)
rails-assets-manifest (~> 3.0, >= 3.0.0)
rails-rfc6570 (~> 3.0)
responders (~> 3.0)
Expand Down
28 changes: 17 additions & 11 deletions bin/bundle
Original file line number Diff line number Diff line change
Expand Up @@ -11,52 +11,56 @@
require "rubygems"

m = Module.new do
module_function
module_function

def invoked_as_script?
File.expand_path($0) == File.expand_path(__FILE__)
File.expand_path($PROGRAM_NAME) == File.expand_path(__FILE__)
end

def env_var_version
ENV["BUNDLER_VERSION"]
ENV.fetch("BUNDLER_VERSION", nil)
end

def cli_arg_version
return unless invoked_as_script? # don't want to hijack other binstubs
return unless "update".start_with?(ARGV.first || " ") # must be running `bundle update`

bundler_version = nil
update_index = nil
ARGV.each_with_index do |a, i|
if update_index && update_index.succ == i && a =~ Gem::Version::ANCHORED_VERSION_PATTERN
bundler_version = a
end
next unless a =~ /\A--bundler(?:[= ](#{Gem::Version::VERSION_PATTERN}))?\z/
bundler_version = $1 || ">= 0.a"
next unless a =~ /\A--bundler(?:[= ](#{Gem::Version::VERSION_PATTERN}))?\z/o

bundler_version = Regexp.last_match(1) || ">= 0.a"
update_index = i
end
bundler_version
end

def gemfile
gemfile = ENV["BUNDLE_GEMFILE"]
return gemfile if gemfile && !gemfile.empty?
gemfile = ENV.fetch("BUNDLE_GEMFILE", nil)
return gemfile if gemfile.present?

File.expand_path("../../Gemfile", __FILE__)
File.expand_path("../Gemfile", __dir__)
end

def lockfile
lockfile =
case File.basename(gemfile)
when "gems.rb" then gemfile.sub(/\.rb$/, gemfile)
else "#{gemfile}.lock"
when "gems.rb" then gemfile.sub(/\.rb$/, gemfile)
else "#{gemfile}.lock"
end
File.expand_path(lockfile)
end

def lockfile_version
return unless File.file?(lockfile)

lockfile_contents = File.read(lockfile)
return unless lockfile_contents =~ /\n\nBUNDLED WITH\n\s{2,}(#{Gem::Version::VERSION_PATTERN})\n/
return unless lockfile_contents =~ /\n\nBUNDLED WITH\n\s{2,}(#{Gem::Version::VERSION_PATTERN})\n/o

Regexp.last_match(1)
end

Expand All @@ -82,10 +86,12 @@ m = Module.new do
gem "bundler", bundler_version
end
return if gem_error.nil?

require_error = activation_error_handling do
require "bundler/version"
end
return if require_error.nil? && Gem::Requirement.new(bundler_version).satisfied_by?(Gem::Version.new(Bundler::VERSION))

warn "Activating bundler (#{bundler_version}) failed:\n#{gem_error.message}\n\nTo install the version of bundler this project requires, run `gem install bundler -v '#{bundler_version}'`"
exit 42
end
Expand Down
4 changes: 4 additions & 0 deletions bin/dev
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
#!/usr/bin/env ruby
# frozen_string_literal: true

exec "./bin/rails", "server", *ARGV
2 changes: 2 additions & 0 deletions bin/rails
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
#!/usr/bin/env ruby
# frozen_string_literal: true

APP_PATH = File.expand_path("../config/application", __dir__)
require_relative "../config/boot"
require "rails/commands"
2 changes: 2 additions & 0 deletions bin/rake
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
#!/usr/bin/env ruby
# frozen_string_literal: true

require_relative "../config/boot"
require "rake"
Rake.application.run
2 changes: 2 additions & 0 deletions bin/rubocop
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
#!/usr/bin/env ruby
# frozen_string_literal: true

require "rubygems"
require "bundler/setup"

Expand Down
Loading

0 comments on commit e14002e

Please sign in to comment.