diff --git a/Gemfile b/Gemfile index c9b79f9f1..248faeeac 100644 --- a/Gemfile +++ b/Gemfile @@ -3,7 +3,7 @@ source 'https://rubygems.org' ruby '3.3.6' # Bundle edge Rails instead: gem 'rails', github: 'rails/rails' -gem 'rails', '~> 6.1' +gem 'rails', '~> 7.0' # Use postgresql as the database for Active Record gem 'pg' # gem 'pg', '1.1.4', platforms: [:mingw, :x64_mingw] @@ -94,7 +94,7 @@ group :development do gem 'listen' # Spring speeds up development by keeping your application running in the background. Read more: https://github.com/rails/spring gem 'spring' - gem 'spring-watcher-listen', '~> 2.0.0' + gem 'spring-watcher-listen' gem 'rails-erd' gem 'letter_opener' gem 'bullet' diff --git a/Gemfile.lock b/Gemfile.lock index f51678906..0c41dfd85 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -63,40 +63,47 @@ GEM GEM remote: https://rubygems.org/ specs: - actioncable (6.1.7.10) - actionpack (= 6.1.7.10) - activesupport (= 6.1.7.10) + actioncable (7.0.8.7) + actionpack (= 7.0.8.7) + activesupport (= 7.0.8.7) nio4r (~> 2.0) websocket-driver (>= 0.6.1) - actionmailbox (6.1.7.10) - actionpack (= 6.1.7.10) - activejob (= 6.1.7.10) - activerecord (= 6.1.7.10) - activestorage (= 6.1.7.10) - activesupport (= 6.1.7.10) + actionmailbox (7.0.8.7) + actionpack (= 7.0.8.7) + activejob (= 7.0.8.7) + activerecord (= 7.0.8.7) + activestorage (= 7.0.8.7) + activesupport (= 7.0.8.7) mail (>= 2.7.1) - actionmailer (6.1.7.10) - actionpack (= 6.1.7.10) - actionview (= 6.1.7.10) - activejob (= 6.1.7.10) - activesupport (= 6.1.7.10) + net-imap + net-pop + net-smtp + actionmailer (7.0.8.7) + actionpack (= 7.0.8.7) + actionview (= 7.0.8.7) + activejob (= 7.0.8.7) + activesupport (= 7.0.8.7) mail (~> 2.5, >= 2.5.4) + net-imap + net-pop + net-smtp rails-dom-testing (~> 2.0) - actionpack (6.1.7.10) - actionview (= 6.1.7.10) - activesupport (= 6.1.7.10) - rack (~> 2.0, >= 2.0.9) + actionpack (7.0.8.7) + actionview (= 7.0.8.7) + activesupport (= 7.0.8.7) + rack (~> 2.0, >= 2.2.4) rack-test (>= 0.6.3) rails-dom-testing (~> 2.0) rails-html-sanitizer (~> 1.0, >= 1.2.0) - actiontext (6.1.7.10) - actionpack (= 6.1.7.10) - activerecord (= 6.1.7.10) - activestorage (= 6.1.7.10) - activesupport (= 6.1.7.10) + actiontext (7.0.8.7) + actionpack (= 7.0.8.7) + activerecord (= 7.0.8.7) + activestorage (= 7.0.8.7) + activesupport (= 7.0.8.7) + globalid (>= 0.6.0) nokogiri (>= 1.8.5) - actionview (6.1.7.10) - activesupport (= 6.1.7.10) + actionview (7.0.8.7) + activesupport (= 7.0.8.7) builder (~> 3.1) erubi (~> 1.4) rails-dom-testing (~> 2.0) @@ -121,29 +128,28 @@ GEM sassc sassc-rails xdan-datetimepicker-rails (~> 2.5.1) - activejob (6.1.7.10) - activesupport (= 6.1.7.10) + activejob (7.0.8.7) + activesupport (= 7.0.8.7) globalid (>= 0.3.6) - activemodel (6.1.7.10) - activesupport (= 6.1.7.10) - activerecord (6.1.7.10) - activemodel (= 6.1.7.10) - activesupport (= 6.1.7.10) + activemodel (7.0.8.7) + activesupport (= 7.0.8.7) + activerecord (7.0.8.7) + activemodel (= 7.0.8.7) + activesupport (= 7.0.8.7) activerecord-nulldb-adapter (0.8.0) activerecord (>= 5.2.0, < 7.1) - activestorage (6.1.7.10) - actionpack (= 6.1.7.10) - activejob (= 6.1.7.10) - activerecord (= 6.1.7.10) - activesupport (= 6.1.7.10) + activestorage (7.0.8.7) + actionpack (= 7.0.8.7) + activejob (= 7.0.8.7) + activerecord (= 7.0.8.7) + activesupport (= 7.0.8.7) marcel (~> 1.0) mini_mime (>= 1.1.0) - activesupport (6.1.7.10) + activesupport (7.0.8.7) concurrent-ruby (~> 1.0, >= 1.0.2) i18n (>= 1.6, < 2) minitest (>= 5.1) tzinfo (~> 2.0) - zeitwerk (~> 2.3) acts_as_list (1.0.4) activerecord (>= 4.2) acts_as_votable (0.13.2) @@ -250,7 +256,7 @@ GEM activerecord (>= 5.a) database_cleaner-core (~> 2.0.0) database_cleaner-core (2.0.1) - date (3.4.0) + date (3.4.1) descendants_tracker (0.0.4) thread_safe (~> 0.3, >= 0.3.1) device_detector (1.0.7) @@ -396,7 +402,7 @@ GEM net-http-digest_auth (1.4.1) net-http-persistent (4.0.4) connection_pool (~> 2.2) - net-imap (0.5.1) + net-imap (0.5.4) date net-protocol net-ldap (0.17.1) @@ -615,21 +621,20 @@ GEM rack_session_access (0.2.0) builder (>= 2.0.0) rack (>= 1.0.0) - rails (6.1.7.10) - actioncable (= 6.1.7.10) - actionmailbox (= 6.1.7.10) - actionmailer (= 6.1.7.10) - actionpack (= 6.1.7.10) - actiontext (= 6.1.7.10) - actionview (= 6.1.7.10) - activejob (= 6.1.7.10) - activemodel (= 6.1.7.10) - activerecord (= 6.1.7.10) - activestorage (= 6.1.7.10) - activesupport (= 6.1.7.10) + rails (7.0.8.7) + actioncable (= 7.0.8.7) + actionmailbox (= 7.0.8.7) + actionmailer (= 7.0.8.7) + actionpack (= 7.0.8.7) + actiontext (= 7.0.8.7) + actionview (= 7.0.8.7) + activejob (= 7.0.8.7) + activemodel (= 7.0.8.7) + activerecord (= 7.0.8.7) + activestorage (= 7.0.8.7) + activesupport (= 7.0.8.7) bundler (>= 1.15.0) - railties (= 6.1.7.10) - sprockets-rails (>= 2.0.0) + railties (= 7.0.8.7) rails-dom-testing (2.2.0) activesupport (>= 5.0.0) minitest @@ -645,12 +650,13 @@ GEM rails-timeago (2.20.0) actionpack (>= 5.2) activesupport (>= 5.2) - railties (6.1.7.10) - actionpack (= 6.1.7.10) - activesupport (= 6.1.7.10) + railties (7.0.8.7) + actionpack (= 7.0.8.7) + activesupport (= 7.0.8.7) method_source rake (>= 12.2) thor (~> 1.0) + zeitwerk (~> 2.5) rainbow (3.1.1) rake (13.2.1) ransack (4.1.1) @@ -790,7 +796,7 @@ GEM thor (1.3.2) thread_safe (0.3.6) tilt (2.0.10) - timeout (0.4.2) + timeout (0.4.3) tinymce-rails (6.8.3) railties (>= 3.1.1) turbolinks (5.2.1) @@ -906,7 +912,7 @@ DEPENDENCIES pry puma (~> 6.4.3) rack_session_access - rails (~> 6.1) + rails (~> 7.0) rails-assets-jquery! rails-assets-jquery.scrollTo! rails-assets-normalize-css! @@ -933,7 +939,7 @@ DEPENDENCIES sidekiq simplecov spring - spring-watcher-listen (~> 2.0.0) + spring-watcher-listen sprockets survey_monkey_api! terser diff --git a/app/models/commontator/thread.rb b/app/models/commontator/thread.rb index a3eb38fdb..28bcb9d22 100644 --- a/app/models/commontator/thread.rb +++ b/app/models/commontator/thread.rb @@ -152,8 +152,10 @@ def nested_comments_for(user, comments, show_all) ).tap do |nested_comments| next unless is_votable? - ActiveRecord::Associations::Preloader.new.preload( - nested_comments.flatten, :votes_for, ActsAsVotable::Vote.where(voter: user) + ActiveRecord::Associations::Preloader.new( + records: nested_comments.flatten, + associations: :votes_for, + scope: ActsAsVotable::Vote.where(voter: user) ) end end diff --git a/config/application.rb b/config/application.rb index 7c0bb3e5a..6ce4d5094 100644 --- a/config/application.rb +++ b/config/application.rb @@ -32,7 +32,7 @@ module DiffusionMarketplace class Application < Rails::Application # Initialize configuration defaults for originally generated Rails version. - config.load_defaults 6.0 + config.load_defaults 7.0 # Settings in config/environments/* take precedence over those specified here. # Application configuration can go into files in config/initializers diff --git a/config/initializers/active_admin.rb b/config/initializers/active_admin.rb index 03ec4a216..ed35b1e4a 100644 --- a/config/initializers/active_admin.rb +++ b/config/initializers/active_admin.rb @@ -63,7 +63,7 @@ # method in a before filter of all controller actions to # ensure that there is a user with proper rights. You can use # CanCanAdapter or make your own. Please refer to documentation. - config.authorization_adapter = AdminAuthAdapter + config.authorization_adapter = "AdminAuthAdapter" # In case you prefer Pundit over other solutions you can here pass # the name of default policy class. This policy will be used in every @@ -311,7 +311,7 @@ # # config.order_clause = MyOrderClause config.namespace :editor do |editor| - editor.authorization_adapter = EditorAuthAdapter + editor.authorization_adapter = "EditorAuthAdapter" editor.site_title = "Community Editor Portal" editor.root_to = 'pages#index' editor.comments_menu = false