From e4e1a2e96e022572e74c461c0dbc0db22d9b42e7 Mon Sep 17 00:00:00 2001 From: Nelson Jovel Date: Wed, 20 Nov 2024 15:16:22 -0800 Subject: [PATCH] chore: update to rails 8 --- Gemfile.lock | 139 ++++++++++++++--------------- app/models/score.rb | 7 -- config/application.rb | 8 +- config/environments/development.rb | 18 ++-- db/schema.rb | 4 +- spec/rails_helper.rb | 2 +- 6 files changed, 86 insertions(+), 92 deletions(-) diff --git a/Gemfile.lock b/Gemfile.lock index 81c62565..1e91cc17 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -12,85 +12,79 @@ GIT GEM remote: https://rubygems.org/ specs: - actioncable (7.1.5) - actionpack (= 7.1.5) - activesupport (= 7.1.5) + 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.1.5) - actionpack (= 7.1.5) - activejob (= 7.1.5) - activerecord (= 7.1.5) - activestorage (= 7.1.5) - activesupport (= 7.1.5) - mail (>= 2.7.1) - net-imap - net-pop - net-smtp - actionmailer (7.1.5) - actionpack (= 7.1.5) - actionview (= 7.1.5) - activejob (= 7.1.5) - activesupport (= 7.1.5) - mail (~> 2.5, >= 2.5.4) - net-imap - net-pop - net-smtp + 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 (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.1.5) - actionview (= 7.1.5) - activesupport (= 7.1.5) + actionpack (8.0.0) + actionview (= 8.0.0) + activesupport (= 8.0.0) nokogiri (>= 1.8.5) - racc rack (>= 2.2.4) rack-session (>= 1.0.1) rack-test (>= 0.6.3) rails-dom-testing (~> 2.2) rails-html-sanitizer (~> 1.6) - actiontext (7.1.5) - actionpack (= 7.1.5) - activerecord (= 7.1.5) - activestorage (= 7.1.5) - activesupport (= 7.1.5) + useragent (~> 0.16) + 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.1.5) - activesupport (= 7.1.5) + 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.1.5) - activesupport (= 7.1.5) + activejob (8.0.0) + activesupport (= 8.0.0) globalid (>= 0.3.6) - activemodel (7.1.5) - activesupport (= 7.1.5) - activerecord (7.1.5) - activemodel (= 7.1.5) - activesupport (= 7.1.5) + activemodel (8.0.0) + activesupport (= 8.0.0) + activerecord (8.0.0) + activemodel (= 8.0.0) + activesupport (= 8.0.0) timeout (>= 0.4.0) activerecord-import (1.5.1) activerecord (>= 4.2) - activestorage (7.1.5) - actionpack (= 7.1.5) - activejob (= 7.1.5) - activerecord (= 7.1.5) - activesupport (= 7.1.5) + 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.1.5) + activesupport (8.0.0) base64 benchmark (>= 0.3) 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 securerandom (>= 0.3) - tzinfo (~> 2.0) + tzinfo (~> 2.0, >= 2.0.5) + uri (>= 0.13.1) addressable (2.8.6) public_suffix (>= 2.0.2, < 6.0) ast (2.4.2) @@ -112,7 +106,7 @@ GEM brakeman (6.1.1) racc builder (3.3.0) - bullet (7.1.5) + bullet (8.0.0) activesupport (>= 3.0.0) uniform_notifier (~> 1.11) byebug (11.1.3) @@ -204,6 +198,7 @@ GEM webrick (~> 1.7) websocket-driver (>= 0.6, < 0.8) ffi (1.16.3) + foreman (0.88.1) formatador (1.1.0) friendly_id (5.1.0) activerecord (>= 4.0.0) @@ -269,7 +264,6 @@ GEM minitest (5.25.1) msgpack (1.7.2) multi_json (1.15.0) - mutex_m (0.3.0) nenv (0.3.0) nested_scaffold (1.1.0) net-imap (0.5.1) @@ -327,20 +321,20 @@ GEM rackup (2.1.0) rack (>= 3) webrick (~> 1.8) - rails (7.1.5) - actioncable (= 7.1.5) - actionmailbox (= 7.1.5) - actionmailer (= 7.1.5) - actionpack (= 7.1.5) - actiontext (= 7.1.5) - actionview (= 7.1.5) - activejob (= 7.1.5) - activemodel (= 7.1.5) - activerecord (= 7.1.5) - activestorage (= 7.1.5) - activesupport (= 7.1.5) + 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.1.5) + railties (= 8.0.0) rails-controller-testing (1.0.5) actionpack (>= 5.0.1.rc1) actionview (>= 5.0.1.rc1) @@ -352,10 +346,10 @@ GEM rails-html-sanitizer (1.6.0) loofah (~> 2.21) nokogiri (~> 1.14) - railties (7.1.5) - actionpack (= 7.1.5) - activesupport (= 7.1.5) - irb + railties (8.0.0) + actionpack (= 8.0.0) + activesupport (= 8.0.0) + irb (~> 1.13) rackup (>= 1.0.0) rake (>= 12.2) thor (~> 1.0, >= 1.2.2) @@ -477,6 +471,8 @@ GEM concurrent-ruby (~> 1.0) unicode-display_width (2.5.0) uniform_notifier (1.16.0) + uri (1.0.2) + useragent (0.16.10) warden (1.2.9) rack (>= 2.0.9) watir (7.3.0) @@ -500,7 +496,7 @@ DEPENDENCIES bcrypt_pbkdf bootsnap brakeman - bullet + bullet (~> 8.0) byebug capybara cssbundling-rails @@ -514,6 +510,7 @@ DEPENDENCIES erb_lint erblint-github factory_bot_rails + foreman friendly_id (~> 5.1.0) guard guard-livereload (~> 2.5) @@ -535,7 +532,7 @@ DEPENDENCIES puma (>= 6.4.0) rack-livereload rack-mini-profiler - rails (~> 7.1.3) + rails (~> 8.0.0) rails-controller-testing rspec-rails (~> 6.0.3) rubocop @@ -551,7 +548,7 @@ DEPENDENCIES watir RUBY VERSION - ruby 3.3.5p100 + ruby 3.3.6p108 BUNDLED WITH 2.5.11 diff --git a/app/models/score.rb b/app/models/score.rb index 8f880855..f9a83206 100644 --- a/app/models/score.rb +++ b/app/models/score.rb @@ -9,13 +9,6 @@ class Score < ApplicationRecord NIL_SCORE = Score.new(average: nil, meets_teacher_threshold: false, meets_student_threshold: false, meets_admin_data_threshold: false) - enum group: { - all_students: 0, - race: 1, - grade: 2, - gender: 3 - } - def in_zone?(zone:) return false if average.nil? || average.is_a?(Float) && average.nan? diff --git a/config/application.rb b/config/application.rb index 8fe72ab3..cbe5e408 100644 --- a/config/application.rb +++ b/config/application.rb @@ -9,10 +9,14 @@ Bundler.require(*Rails.groups) module Edcontext class Application < Rails::Application - config.load_defaults 7.1 + config.load_defaults 8.0 # Settings in config/environments/* take precedence over those specified here. # Application configuration should go into files in config/initializers # -- all .rb files in that directory are automatically loaded. - config.active_support.cache_format_version 6.1 + # + # Please, add to the `ignore` list any other `lib` subdirectories that do + # not contain `.rb` files, or that should not be reloaded or eager loaded. + # Common ones are `templates`, `generators`, or `middleware`, for example. + config.autoload_lib(ignore: %w[assets tasks]) end end diff --git a/config/environments/development.rb b/config/environments/development.rb index 6e5dc553..334fd0ec 100644 --- a/config/environments/development.rb +++ b/config/environments/development.rb @@ -1,13 +1,13 @@ Rails.application.configure do - config.after_initialize do - Bullet.enable = true - Bullet.alert = false - Bullet.bullet_logger = true - Bullet.console = true - # Bullet.growl = true - Bullet.rails_logger = true - Bullet.add_footer = true - end + # config.after_initialize do + # Bullet.enable = true + # Bullet.alert = false + # Bullet.bullet_logger = true + # Bullet.console = true + # # Bullet.growl = true + # Bullet.rails_logger = true + # Bullet.add_footer = true + # end # Settings specified here will take precedence over those in config/application.rb. diff --git a/db/schema.rb b/db/schema.rb index 927278d4..55ac8504 100644 --- a/db/schema.rb +++ b/db/schema.rb @@ -10,9 +10,9 @@ # # It's strongly recommended that you check this file into your version control system. -ActiveRecord::Schema[7.1].define(version: 2024_10_31_205926) do +ActiveRecord::Schema[8.0].define(version: 2024_10_31_205926) do # These are extensions that must be enabled in order to support this database - enable_extension "plpgsql" + enable_extension "pg_catalog.plpgsql" create_table "academic_years", id: :serial, force: :cascade do |t| t.string "range", null: false diff --git a/spec/rails_helper.rb b/spec/rails_helper.rb index 95b0f8fd..0610ec72 100644 --- a/spec/rails_helper.rb +++ b/spec/rails_helper.rb @@ -65,7 +65,7 @@ RSpec.configure do |config| # end config.before(:suite) do DatabaseCleaner.strategy = :transaction - DatabaseCleaner.clean_with(:truncation) + DatabaseCleaner.clean end config.before(:each) do |example|