Skip to content

Commit

Permalink
Merge pull request #332 from code0-tech/renovate/major-ruby-on-rails-…
Browse files Browse the repository at this point in the history
…packages

Update dependency rails to v8
  • Loading branch information
Taucher2003 authored Nov 16, 2024
2 parents 452306c + ed25b5c commit c5a566f
Show file tree
Hide file tree
Showing 7 changed files with 106 additions and 84 deletions.
2 changes: 1 addition & 1 deletion Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ source 'https://rubygems.org'
ruby '3.2.2'

# Bundle edge Rails instead: gem "rails", github: "rails/rails", branch: "main"
gem 'rails', '~> 7.2.0'
gem 'rails', '~> 8.0.0'

# Use postgresql as the database for Active Record
gem 'pg', '~> 1.1'
Expand Down
137 changes: 68 additions & 69 deletions Gemfile.lock
Original file line number Diff line number Diff line change
@@ -1,66 +1,65 @@
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)
activerecord (7.2.2)
activemodel (= 7.2.2)
activesupport (= 7.2.2)
activemodel (8.0.0)
activesupport (= 8.0.0)
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 @@ -72,10 +71,11 @@ GEM
minitest (>= 5.1)
securerandom (>= 0.3)
tzinfo (~> 2.0, >= 2.0.5)
uri (>= 0.13.1)
ast (2.4.2)
base64 (0.2.0)
bcrypt (3.1.20)
benchmark (0.3.0)
benchmark (0.4.0)
bigdecimal (3.1.8)
binding_of_caller (1.0.0)
debug_inspector (>= 0.0.1)
Expand All @@ -95,7 +95,7 @@ GEM
activerecord (>= 5.a)
database_cleaner-core (~> 2.0.0)
database_cleaner-core (2.0.1)
date (3.3.4)
date (3.4.0)
debug (1.9.2)
irb (~> 1.10)
reline (>= 0.3.8)
Expand Down Expand Up @@ -152,7 +152,7 @@ GEM
activesupport (>= 4)
railties (>= 4)
request_store (~> 1.0)
loofah (2.22.0)
loofah (2.23.1)
crass (~> 1.0.2)
nokogiri (>= 1.12.0)
mail (2.8.1)
Expand All @@ -167,7 +167,7 @@ GEM
msgpack (1.7.2)
multi_xml (0.7.1)
bigdecimal (~> 3.1)
net-imap (0.4.17)
net-imap (0.5.1)
date
net-protocol
net-pop (0.1.2)
Expand All @@ -194,7 +194,7 @@ GEM
pry-byebug (3.10.1)
byebug (~> 11.0)
pry (>= 0.13, < 0.15)
psych (5.1.2)
psych (5.2.0)
stringio
puma (6.4.3)
nio4r (~> 2.0)
Expand All @@ -205,33 +205,32 @@ GEM
rack (>= 3.0.0)
rack-test (2.1.0)
rack (>= 1.3)
rackup (2.1.0)
rackup (2.2.0)
rack (>= 3)
webrick (~> 1.8)
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-dom-testing (2.2.0)
activesupport (>= 5.0.0)
minitest
nokogiri (>= 1.6)
rails-html-sanitizer (1.6.0)
loofah (~> 2.21)
nokogiri (~> 1.14)
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 @@ -242,7 +241,7 @@ GEM
rdoc (6.7.0)
psych (>= 4.0.0)
regexp_parser (2.9.2)
reline (0.5.10)
reline (0.5.11)
io-console (~> 0.5)
request_store (1.5.1)
rack (>= 1.4)
Expand Down Expand Up @@ -309,7 +308,7 @@ GEM
rubocop (~> 1.61)
rubocop-rspec (~> 3, >= 3.0.1)
ruby-progressbar (1.13.0)
securerandom (0.3.1)
securerandom (0.3.2)
seed-fu (2.3.9)
activerecord (>= 3.1)
activesupport (>= 3.1)
Expand All @@ -324,10 +323,10 @@ GEM
simplecov (~> 0.19)
simplecov-html (0.12.3)
simplecov_json_formatter (0.1.4)
stringio (3.1.1)
stringio (3.1.2)
test-prof (1.4.2)
thor (1.3.2)
timeout (0.4.1)
timeout (0.4.2)
tucana (0.0.8)
grpc (~> 1.64)
tzinfo (2.0.6)
Expand All @@ -336,12 +335,12 @@ GEM
unparser (0.6.13)
diff-lcs (~> 1.3)
parser (>= 3.3.0)
uri (1.0.1)
useragent (0.16.10)
webrick (1.8.2)
websocket-driver (0.7.6)
websocket-extensions (>= 0.1.0)
websocket-extensions (0.1.5)
zeitwerk (2.6.18)
zeitwerk (2.7.1)

PLATFORMS
x86_64-linux
Expand All @@ -363,7 +362,7 @@ DEPENDENCIES
pry (~> 0.14.2)
pry-byebug (~> 3.10)
puma (>= 5.0)
rails (~> 7.2.0)
rails (~> 8.0.0)
rotp
rspec-parameterized (~> 1.0)
rspec-rails (~> 7.0)
Expand Down
2 changes: 1 addition & 1 deletion config/application.rb
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@

module Sagittarius
class Application < Rails::Application
config.load_defaults 7.2
config.load_defaults 8.0

# Use SQL instead of Active Record's schema dumper when creating the database.
# This is necessary if your schema can't be completely dumped by the schema dumper,
Expand Down
22 changes: 22 additions & 0 deletions config/initializers/rails_code_statistics.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
# frozen_string_literal: true

return unless defined?(Rails::Command::StatsCommand)

Rails::CodeStatistics.directories.clear
Rails::CodeStatistics.test_types.clear

%w[Controllers Finders GraphQL GRPC Jobs Mailers Models Policies Services].each do |type|
Rails::CodeStatistics.register_directory(type, "app/#{type.downcase}")
end

%w[Config DB Lib Tooling].each do |type|
Rails::CodeStatistics.register_directory(type, type.downcase)
end

%w[Config Finders GraphQL GRPC Lib Models Policies Requests Services Tooling].each do |type|
Rails::CodeStatistics.register_directory("#{type} specs", "spec/#{type.downcase}", test_directory: true)
end

%w[factories support].each do |type|
Rails::CodeStatistics.register_directory("Spec #{type}", "spec/#{type}", test_directory: true)
end
1 change: 1 addition & 0 deletions lib/sagittarius/database/schema_migrations/migrations.rb
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ def touch_all

def load_all
return if version_filenames.empty?
return unless @context.connection.pool.schema_migration.table_exists?

values = version_filenames.map { |vf| "('#{@context.connection.quote_string(vf)}')" }

Expand Down
13 changes: 0 additions & 13 deletions lib/tasks/statistics.rake

This file was deleted.

13 changes: 13 additions & 0 deletions spec/lib/sagittarius/database/schema_migrations/migrations_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,7 @@
let(:filenames) { %w[123 456 789] }

it 'inserts the missing versions into schema_migrations' do
allow(connection).to receive(:quote_string).with('schema_migrations').and_return('schema_migrations')
filenames.each do |filename|
allow(connection).to receive(:quote_string).with(filename).and_return(filename)
end
Expand All @@ -96,6 +97,18 @@
ON CONFLICT DO NOTHING
SQL
end

it 'does nothing if schema_migrations table does not exist' do
allow(connection).to receive(:execute)

schema_migration = connection.pool.schema_migration
allow(connection.pool).to receive(:schema_migration).and_return(schema_migration)
allow(schema_migration).to receive(:table_exists?).and_return(false)

migrations.load_all

expect(connection).not_to have_received(:execute)
end
end
end
end

0 comments on commit c5a566f

Please sign in to comment.