diff --git a/Gemfile b/Gemfile index bd878450..6cbee864 100644 --- a/Gemfile +++ b/Gemfile @@ -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.1.2' +gem 'rails', '~> 7.2.0' # Use postgresql as the database for Active Record gem 'pg', '~> 1.1' diff --git a/Gemfile.lock b/Gemfile.lock index 4c01d937..a292109f 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -1,80 +1,76 @@ GEM remote: https://rubygems.org/ specs: - actioncable (7.1.3.4) - actionpack (= 7.1.3.4) - activesupport (= 7.1.3.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.3.4) - actionpack (= 7.1.3.4) - activejob (= 7.1.3.4) - activerecord (= 7.1.3.4) - activestorage (= 7.1.3.4) - activesupport (= 7.1.3.4) - mail (>= 2.7.1) - net-imap - net-pop - net-smtp - actionmailer (7.1.3.4) - actionpack (= 7.1.3.4) - actionview (= 7.1.3.4) - activejob (= 7.1.3.4) - activesupport (= 7.1.3.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.3.4) - actionview (= 7.1.3.4) - activesupport (= 7.1.3.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.3.4) - actionpack (= 7.1.3.4) - activerecord (= 7.1.3.4) - activestorage (= 7.1.3.4) - activesupport (= 7.1.3.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.3.4) - activesupport (= 7.1.3.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.3.4) - activesupport (= 7.1.3.4) + activejob (7.2.1) + activesupport (= 7.2.1) globalid (>= 0.3.6) - activemodel (7.1.3.4) - activesupport (= 7.1.3.4) - activerecord (7.1.3.4) - activemodel (= 7.1.3.4) - activesupport (= 7.1.3.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.3.4) - actionpack (= 7.1.3.4) - activejob (= 7.1.3.4) - activerecord (= 7.1.3.4) - activesupport (= 7.1.3.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.3.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) ast (2.4.2) base64 (0.2.0) bcrypt (3.1.20) @@ -137,7 +133,7 @@ GEM grpc (1.64.3-x86_64-linux) google-protobuf (~> 3.25) googleapis-common-protos-types (~> 1.0) - i18n (1.14.5) + i18n (1.14.6) concurrent-ruby (~> 1.0) io-console (0.7.2) irb (1.14.0) @@ -145,6 +141,7 @@ GEM reline (>= 0.4.2) json (2.7.2) language_server-protocol (3.17.0.3) + logger (1.6.1) lograge (0.14.0) actionpack (>= 4) activesupport (>= 4) @@ -164,17 +161,16 @@ GEM minitest (5.25.1) msgpack (1.7.2) multi_json (1.15.0) - mutex_m (0.2.0) - net-imap (0.4.12) + net-imap (0.4.16) date net-protocol net-pop (0.1.2) net-protocol net-protocol (0.2.2) timeout - net-smtp (0.4.0.1) + net-smtp (0.5.0) net-protocol - nio4r (2.6.1) + nio4r (2.7.3) nokogiri (1.16.7-x86_64-linux) racc (~> 1.4) parallel (1.25.1) @@ -206,20 +202,20 @@ GEM rackup (2.1.0) rack (>= 3) webrick (~> 1.8) - rails (7.1.3.4) - actioncable (= 7.1.3.4) - actionmailbox (= 7.1.3.4) - actionmailer (= 7.1.3.4) - actionpack (= 7.1.3.4) - actiontext (= 7.1.3.4) - actionview (= 7.1.3.4) - activejob (= 7.1.3.4) - activemodel (= 7.1.3.4) - activerecord (= 7.1.3.4) - activestorage (= 7.1.3.4) - activesupport (= 7.1.3.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.3.4) + railties (= 7.2.1) rails-dom-testing (2.2.0) activesupport (>= 5.0.0) minitest @@ -227,10 +223,10 @@ GEM rails-html-sanitizer (1.6.0) loofah (~> 2.21) nokogiri (~> 1.14) - railties (7.1.3.4) - actionpack (= 7.1.3.4) - activesupport (= 7.1.3.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) @@ -309,6 +305,7 @@ GEM rubocop (~> 1.61) rubocop-rspec (~> 3, >= 3.0.1) ruby-progressbar (1.13.0) + securerandom (0.3.1) seed-fu (2.3.9) activerecord (>= 3.1) activesupport (>= 3.1) @@ -336,6 +333,7 @@ GEM unparser (0.6.13) diff-lcs (~> 1.3) parser (>= 3.3.0) + useragent (0.16.10) webrick (1.8.1) websocket-driver (0.7.6) websocket-extensions (>= 0.1.0) @@ -362,7 +360,7 @@ DEPENDENCIES pry (~> 0.14.2) pry-byebug (~> 3.10) puma (>= 5.0) - rails (~> 7.1.2) + rails (~> 7.2.0) rotp rspec-parameterized (~> 1.0) rspec-rails (~> 6.0) diff --git a/bin/rubocop b/bin/rubocop new file mode 100644 index 00000000..40330c0f --- /dev/null +++ b/bin/rubocop @@ -0,0 +1,8 @@ +#!/usr/bin/env ruby +require "rubygems" +require "bundler/setup" + +# explicit rubocop config increases performance slightly while avoiding config confusion. +ARGV.unshift("--config", File.expand_path("../.rubocop.yml", __dir__)) + +load Gem.bin_path("rubocop", "rubocop") diff --git a/config/application.rb b/config/application.rb index 65886c83..4b44e13a 100644 --- a/config/application.rb +++ b/config/application.rb @@ -14,8 +14,7 @@ module Sagittarius class Application < Rails::Application - # Initialize configuration defaults for originally generated Rails version. - config.load_defaults 7.1 + config.load_defaults 7.2 # 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, diff --git a/config/initializers/filter_parameter_logging.rb b/config/initializers/filter_parameter_logging.rb index b6d5b30b..08a2d082 100644 --- a/config/initializers/filter_parameter_logging.rb +++ b/config/initializers/filter_parameter_logging.rb @@ -6,5 +6,5 @@ # 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 secret token _key crypt salt certificate otp ssn query variables + passw email secret token _key crypt salt certificate otp ssn query variables ] diff --git a/config/sagittarius.example.yml b/config/sagittarius.example.yml index 8509db71..378333c9 100644 --- a/config/sagittarius.example.yml +++ b/config/sagittarius.example.yml @@ -1,5 +1,5 @@ rails: - threads: 5 + threads: 3 web: port: 3000 force_ssl: diff --git a/lib/sagittarius/configuration.rb b/lib/sagittarius/configuration.rb index 3e0e302f..69a142f6 100644 --- a/lib/sagittarius/configuration.rb +++ b/lib/sagittarius/configuration.rb @@ -20,7 +20,7 @@ def self.application_setting_overrides def self.defaults { rails: { - threads: 5, + threads: 3, web: { port: 3000, force_ssl: nil, diff --git a/lib/sagittarius/database/schema_migrations/context.rb b/lib/sagittarius/database/schema_migrations/context.rb index 59756bfc..e3143e23 100644 --- a/lib/sagittarius/database/schema_migrations/context.rb +++ b/lib/sagittarius/database/schema_migrations/context.rb @@ -24,8 +24,8 @@ def schema_directory end def versions_to_create - versions_from_database = @connection.schema_migration.versions - versions_from_migration_files = @connection.migration_context.migrations.map { |m| m.version.to_s } + versions_from_database = @connection.pool.schema_migration.versions + versions_from_migration_files = @connection.pool.migration_context.migrations.map { |m| m.version.to_s } versions_from_database & versions_from_migration_files end diff --git a/spec/lib/sagittarius/database/schema_migrations/context_spec.rb b/spec/lib/sagittarius/database/schema_migrations/context_spec.rb index 2cc7e2bf..5511f454 100644 --- a/spec/lib/sagittarius/database/schema_migrations/context_spec.rb +++ b/spec/lib/sagittarius/database/schema_migrations/context_spec.rb @@ -22,11 +22,11 @@ describe '#versions_to_create' do before do # rubocop:disable RSpec/MessageChain -- we are mocking into active records structure - allow(connection).to receive_message_chain(:schema_migration, :versions).and_return(migrated_versions) + allow(connection.pool).to receive_message_chain(:schema_migration, :versions).and_return(migrated_versions) migrations_struct = Struct.new(:version) migrations = file_versions.map { |version| migrations_struct.new(version) } - allow(connection).to receive_message_chain(:migration_context, :migrations).and_return(migrations) + allow(connection.pool).to receive_message_chain(:migration_context, :migrations).and_return(migrations) # rubocop:enable RSpec/MessageChain end