diff --git a/.rubocop.yml b/.rubocop.yml index 3b952f5e1c4..c882e675be8 100644 --- a/.rubocop.yml +++ b/.rubocop.yml @@ -28,7 +28,7 @@ AllCops: - 'vendor/**/*' - 'public/**/*' TargetRubyVersion: 3.2.0 - TargetRailsVersion: 7.1 + TargetRailsVersion: 7.2 UseCache: true DisabledByDefault: true SuggestExtensions: false diff --git a/Gemfile b/Gemfile index e96adfe135d..70131c68b55 100644 --- a/Gemfile +++ b/Gemfile @@ -3,7 +3,7 @@ git_source(:github) { |repo_name| "https://github.com/#{repo_name}.git" } ruby "~> #{File.read(File.join(__dir__, '.ruby-version')).strip}" -gem 'rails', '~> 7.1.4' +gem 'rails', '~> 7.2.1' gem 'ahoy_matey', '~> 3.0' # pod identity requires 3.188.0 @@ -117,7 +117,7 @@ group :development, :test do gem 'pry-rails' gem 'psych' gem 'rspec', '~> 3.13.0' - gem 'rspec-rails', '~> 6.0' + gem 'rspec-rails', '~> 7.0' gem 'rubocop', '~> 1.62.0', require: false gem 'rubocop-performance', '~> 1.20.2', require: false gem 'rubocop-rails', '>= 2.26.2', require: false diff --git a/Gemfile.lock b/Gemfile.lock index 9dbc4929498..149c90bb090 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -79,80 +79,76 @@ GIT GEM remote: https://rubygems.org/ specs: - actioncable (7.1.4.1) - actionpack (= 7.1.4.1) - activesupport (= 7.1.4.1) + actioncable (7.2.1.1) + actionpack (= 7.2.1.1) + activesupport (= 7.2.1.1) nio4r (~> 2.0) websocket-driver (>= 0.6.1) zeitwerk (~> 2.6) - actionmailbox (7.1.4.1) - actionpack (= 7.1.4.1) - activejob (= 7.1.4.1) - activerecord (= 7.1.4.1) - activestorage (= 7.1.4.1) - activesupport (= 7.1.4.1) - mail (>= 2.7.1) - net-imap - net-pop - net-smtp - actionmailer (7.1.4.1) - actionpack (= 7.1.4.1) - actionview (= 7.1.4.1) - activejob (= 7.1.4.1) - activesupport (= 7.1.4.1) - mail (~> 2.5, >= 2.5.4) - net-imap - net-pop - net-smtp + actionmailbox (7.2.1.1) + actionpack (= 7.2.1.1) + activejob (= 7.2.1.1) + activerecord (= 7.2.1.1) + activestorage (= 7.2.1.1) + activesupport (= 7.2.1.1) + mail (>= 2.8.0) + actionmailer (7.2.1.1) + actionpack (= 7.2.1.1) + actionview (= 7.2.1.1) + activejob (= 7.2.1.1) + activesupport (= 7.2.1.1) + mail (>= 2.8.0) rails-dom-testing (~> 2.2) - actionpack (7.1.4.1) - actionview (= 7.1.4.1) - activesupport (= 7.1.4.1) + actionpack (7.2.1.1) + actionview (= 7.2.1.1) + activesupport (= 7.2.1.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.1) - actionpack (= 7.1.4.1) - activerecord (= 7.1.4.1) - activestorage (= 7.1.4.1) - activesupport (= 7.1.4.1) + useragent (~> 0.16) + actiontext (7.2.1.1) + actionpack (= 7.2.1.1) + activerecord (= 7.2.1.1) + activestorage (= 7.2.1.1) + activesupport (= 7.2.1.1) globalid (>= 0.6.0) nokogiri (>= 1.8.5) - actionview (7.1.4.1) - activesupport (= 7.1.4.1) + actionview (7.2.1.1) + activesupport (= 7.2.1.1) builder (~> 3.1) erubi (~> 1.11) rails-dom-testing (~> 2.2) rails-html-sanitizer (~> 1.6) - activejob (7.1.4.1) - activesupport (= 7.1.4.1) + activejob (7.2.1.1) + activesupport (= 7.2.1.1) globalid (>= 0.3.6) - activemodel (7.1.4.1) - activesupport (= 7.1.4.1) - activerecord (7.1.4.1) - activemodel (= 7.1.4.1) - activesupport (= 7.1.4.1) + activemodel (7.2.1.1) + activesupport (= 7.2.1.1) + activerecord (7.2.1.1) + activemodel (= 7.2.1.1) + activesupport (= 7.2.1.1) timeout (>= 0.4.0) - activestorage (7.1.4.1) - actionpack (= 7.1.4.1) - activejob (= 7.1.4.1) - activerecord (= 7.1.4.1) - activesupport (= 7.1.4.1) + activestorage (7.2.1.1) + actionpack (= 7.2.1.1) + activejob (= 7.2.1.1) + activerecord (= 7.2.1.1) + activesupport (= 7.2.1.1) marcel (~> 1.0) - activesupport (7.1.4.1) + activesupport (7.2.1.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) ahoy_matey (3.3.0) @@ -395,7 +391,7 @@ GEM listen (3.8.0) rb-fsevent (~> 0.10, >= 0.10.3) rb-inotify (~> 0.9, >= 0.9.10) - logger (1.6.0) + logger (1.6.1) lograge (0.11.2) actionpack (>= 4) activesupport (>= 4) @@ -433,7 +429,6 @@ GEM minitest (5.24.1) msgpack (1.7.2) multiset (0.5.3) - mutex_m (0.2.0) net-http (0.4.1) uri net-http-persistent (4.0.2) @@ -523,20 +518,20 @@ GEM rackup (2.1.0) rack (>= 3) webrick (~> 1.8) - rails (7.1.4.1) - actioncable (= 7.1.4.1) - actionmailbox (= 7.1.4.1) - actionmailer (= 7.1.4.1) - actionpack (= 7.1.4.1) - actiontext (= 7.1.4.1) - actionview (= 7.1.4.1) - activejob (= 7.1.4.1) - activemodel (= 7.1.4.1) - activerecord (= 7.1.4.1) - activestorage (= 7.1.4.1) - activesupport (= 7.1.4.1) + rails (7.2.1.1) + actioncable (= 7.2.1.1) + actionmailbox (= 7.2.1.1) + actionmailer (= 7.2.1.1) + actionpack (= 7.2.1.1) + actiontext (= 7.2.1.1) + actionview (= 7.2.1.1) + activejob (= 7.2.1.1) + activemodel (= 7.2.1.1) + activerecord (= 7.2.1.1) + activestorage (= 7.2.1.1) + activesupport (= 7.2.1.1) bundler (>= 1.15.0) - railties (= 7.1.4.1) + railties (= 7.2.1.1) rails-controller-testing (1.0.5) actionpack (>= 5.0.1.rc1) actionview (>= 5.0.1.rc1) @@ -551,10 +546,10 @@ GEM rails-i18n (7.0.6) i18n (>= 0.7, < 2) railties (>= 6.0.0, < 8) - railties (7.1.4.1) - actionpack (= 7.1.4.1) - activesupport (= 7.1.4.1) - irb + railties (7.2.1.1) + actionpack (= 7.2.1.1) + activesupport (= 7.2.1.1) + irb (~> 1.13) rackup (>= 1.0.0) rake (>= 12.2) thor (~> 1.0, >= 1.2.2) @@ -592,22 +587,22 @@ GEM rspec-core (~> 3.13.0) rspec-expectations (~> 3.13.0) rspec-mocks (~> 3.13.0) - rspec-core (3.13.0) + rspec-core (3.13.1) rspec-support (~> 3.13.0) - rspec-expectations (3.13.0) + rspec-expectations (3.13.3) diff-lcs (>= 1.2.0, < 2.0) rspec-support (~> 3.13.0) - rspec-mocks (3.13.0) + rspec-mocks (3.13.2) diff-lcs (>= 1.2.0, < 2.0) rspec-support (~> 3.13.0) - rspec-rails (6.0.3) - actionpack (>= 6.1) - activesupport (>= 6.1) - railties (>= 6.1) - rspec-core (~> 3.12) - rspec-expectations (~> 3.12) - rspec-mocks (~> 3.12) - rspec-support (~> 3.12) + 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) + rspec-support (~> 3.13) rspec-retry (0.6.2) rspec-core (> 3.3) rspec-support (3.13.1) @@ -656,6 +651,7 @@ GEM jwt (~> 2.0) scrypt (3.0.7) ffi-compiler (>= 1.0, < 2.0) + securerandom (0.3.1) selenium-webdriver (4.22.0) base64 (~> 0.2) logger (~> 1.4) @@ -706,6 +702,7 @@ GEM unicode-display_width (2.5.0) uniform_notifier (1.16.0) uri (0.13.0) + useragent (0.16.10) view_component (3.9.0) activesupport (>= 5.2.0, < 8.0) concurrent-ruby (~> 1.0) @@ -837,7 +834,7 @@ DEPENDENCIES rack-test (>= 1.1.0) rack-timeout rack_session_access (>= 0.2.0) - rails (~> 7.1.4) + rails (~> 7.2.1) rails-controller-testing (>= 1.0.4) redacted_struct redis (>= 3.2.0) @@ -847,7 +844,7 @@ DEPENDENCIES rotp (~> 6.3, >= 6.3.0) rqrcode rspec (~> 3.13.0) - rspec-rails (~> 6.0) + rspec-rails (~> 7.0) rspec-retry rspec_junit_formatter rubocop (~> 1.62.0) diff --git a/app/models/user.rb b/app/models/user.rb index b5eb603eddd..5d53cc38dac 100644 --- a/app/models/user.rb +++ b/app/models/user.rb @@ -98,7 +98,7 @@ def last_identity end def active_identities - identities.where('session_uuid IS NOT ?', nil).order(last_authenticated_at: :asc) || [] + identities.where.not(session_uuid: nil).order(last_authenticated_at: :asc) || [] end def active_profile? diff --git a/config/application.rb b/config/application.rb index 76208070a1c..64f212ce46f 100644 --- a/config/application.rb +++ b/config/application.rb @@ -59,7 +59,7 @@ class Application < Rails::Application end end - config.load_defaults '7.1' + config.load_defaults '7.2' config.active_record.belongs_to_required_by_default = false config.active_job.queue_adapter = :good_job diff --git a/config/environments/production.rb b/config/environments/production.rb index 5097c9f195f..35df3e3e9d2 100644 --- a/config/environments/production.rb +++ b/config/environments/production.rb @@ -27,7 +27,7 @@ if IdentityConfig.store.rails_mailer_previews_enabled config.action_mailer.show_previews = true - config.action_mailer.preview_path = Rails.root.join('spec/mailers/previews') + config.action_mailer.preview_paths = [Rails.root.join('spec/mailers/previews')] end routes.default_url_options[:protocol] = :https diff --git a/db/schema.rb b/db/schema.rb index a20b704ba51..40617fc275e 100644 --- a/db/schema.rb +++ b/db/schema.rb @@ -10,7 +10,7 @@ # # It's strongly recommended that you check this file into your version control system. -ActiveRecord::Schema[7.1].define(version: 2024_10_17_153042) do +ActiveRecord::Schema[7.2].define(version: 2024_10_17_153042) do # These are extensions that must be enabled in order to support this database enable_extension "citext" enable_extension "pg_stat_statements" diff --git a/db/worker_jobs_schema.rb b/db/worker_jobs_schema.rb index 3398c6bca59..3e6fa136f59 100644 --- a/db/worker_jobs_schema.rb +++ b/db/worker_jobs_schema.rb @@ -10,7 +10,7 @@ # # It's strongly recommended that you check this file into your version control system. -ActiveRecord::Schema[7.1].define(version: 2024_10_21_192437) do +ActiveRecord::Schema[7.2].define(version: 2024_10_21_192437) do # These are extensions that must be enabled in order to support this database enable_extension "pgcrypto" enable_extension "plpgsql" @@ -102,5 +102,4 @@ t.index ["queue_name", "scheduled_at"], name: "index_good_jobs_on_queue_name_and_scheduled_at", where: "(finished_at IS NULL)" t.index ["scheduled_at"], name: "index_good_jobs_on_scheduled_at", where: "(finished_at IS NULL)" end - end diff --git a/lib/tasks/check_for_pending_migrations.rake b/lib/tasks/check_for_pending_migrations.rake index c038c71401e..bc8a3d87a93 100644 --- a/lib/tasks/check_for_pending_migrations.rake +++ b/lib/tasks/check_for_pending_migrations.rake @@ -12,7 +12,7 @@ namespace :db do ) warn('Skipping pending migration check, idp_run_migrations=true') else - ActiveRecord::Migration.check_pending!(ActiveRecord::Base.connection) + ActiveRecord::Migration.check_all_pending!(ActiveRecord::Base.connection) end end end diff --git a/spec/lib/data_pull_spec.rb b/spec/lib/data_pull_spec.rb index de649d74f3f..640f0741544 100644 --- a/spec/lib/data_pull_spec.rb +++ b/spec/lib/data_pull_spec.rb @@ -458,8 +458,8 @@ expect(result.table).to match_array( [ %w[uuid date events_count], - [user.uuid, '2023-01-02', 5], - [user.uuid, '2023-01-01', 1], + [user.uuid, Date.new(2023, 1, 2), 5], + [user.uuid, Date.new(2023, 1, 1), 1], ['uuid-does-not-exist', '[UUID NOT FOUND]', nil], ], )