From 11079ed2ce1f0cc91f7c8a607c17b7b30e621abf Mon Sep 17 00:00:00 2001 From: Ryan Turner <100864486+Turnlings@users.noreply.github.com> Date: Tue, 14 Jul 2026 17:59:34 +0100 Subject: [PATCH 1/3] chore: bump rails --- Gemfile | 2 +- Gemfile.lock | 143 +++++++++++++++++++++++++-------------------------- 2 files changed, 72 insertions(+), 73 deletions(-) diff --git a/Gemfile b/Gemfile index a39ae1b..7f7b33f 100644 --- a/Gemfile +++ b/Gemfile @@ -5,7 +5,7 @@ source 'https://rubygems.org' ruby '3.3.1' # Bundle edge Rails instead: gem "rails", github: "rails/rails", branch: "main" -gem 'rails', '~> 7.2.3', '>= 7.2.3.1' +gem 'rails', '~> 8.0.0' # The original asset pipeline for Rails [https://github.com/rails/sprockets-rails] gem 'sprockets-rails' diff --git a/Gemfile.lock b/Gemfile.lock index df9b8e9..8f8d753 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -1,68 +1,65 @@ GEM remote: https://rubygems.org/ specs: - actioncable (7.2.3.1) - actionpack (= 7.2.3.1) - activesupport (= 7.2.3.1) + actioncable (8.0.5) + actionpack (= 8.0.5) + activesupport (= 8.0.5) nio4r (~> 2.0) websocket-driver (>= 0.6.1) zeitwerk (~> 2.6) - actionmailbox (7.2.3.1) - actionpack (= 7.2.3.1) - activejob (= 7.2.3.1) - activerecord (= 7.2.3.1) - activestorage (= 7.2.3.1) - activesupport (= 7.2.3.1) + actionmailbox (8.0.5) + actionpack (= 8.0.5) + activejob (= 8.0.5) + activerecord (= 8.0.5) + activestorage (= 8.0.5) + activesupport (= 8.0.5) mail (>= 2.8.0) - actionmailer (7.2.3.1) - actionpack (= 7.2.3.1) - actionview (= 7.2.3.1) - activejob (= 7.2.3.1) - activesupport (= 7.2.3.1) + actionmailer (8.0.5) + actionpack (= 8.0.5) + actionview (= 8.0.5) + activejob (= 8.0.5) + activesupport (= 8.0.5) mail (>= 2.8.0) rails-dom-testing (~> 2.2) - actionpack (7.2.3.1) - actionview (= 7.2.3.1) - activesupport (= 7.2.3.1) - cgi + actionpack (8.0.5) + actionview (= 8.0.5) + activesupport (= 8.0.5) nokogiri (>= 1.8.5) - racc - rack (>= 2.2.4, < 3.3) + 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.3.1) - actionpack (= 7.2.3.1) - activerecord (= 7.2.3.1) - activestorage (= 7.2.3.1) - activesupport (= 7.2.3.1) + actiontext (8.0.5) + actionpack (= 8.0.5) + activerecord (= 8.0.5) + activestorage (= 8.0.5) + activesupport (= 8.0.5) globalid (>= 0.6.0) nokogiri (>= 1.8.5) - actionview (7.2.3.1) - activesupport (= 7.2.3.1) + actionview (8.0.5) + activesupport (= 8.0.5) builder (~> 3.1) - cgi erubi (~> 1.11) rails-dom-testing (~> 2.2) rails-html-sanitizer (~> 1.6) - activejob (7.2.3.1) - activesupport (= 7.2.3.1) + activejob (8.0.5) + activesupport (= 8.0.5) globalid (>= 0.3.6) - activemodel (7.2.3.1) - activesupport (= 7.2.3.1) - activerecord (7.2.3.1) - activemodel (= 7.2.3.1) - activesupport (= 7.2.3.1) + activemodel (8.0.5) + activesupport (= 8.0.5) + activerecord (8.0.5) + activemodel (= 8.0.5) + activesupport (= 8.0.5) timeout (>= 0.4.0) - activestorage (7.2.3.1) - actionpack (= 7.2.3.1) - activejob (= 7.2.3.1) - activerecord (= 7.2.3.1) - activesupport (= 7.2.3.1) + activestorage (8.0.5) + actionpack (= 8.0.5) + activejob (= 8.0.5) + activerecord (= 8.0.5) + activesupport (= 8.0.5) marcel (~> 1.0) - activesupport (7.2.3.1) + activesupport (8.0.5) base64 benchmark (>= 0.3) bigdecimal @@ -71,9 +68,10 @@ GEM drb i18n (>= 1.6, < 2) logger (>= 1.4.2) - minitest (>= 5.1, < 6) + minitest (>= 5.1) securerandom (>= 0.3) tzinfo (~> 2.0, >= 2.0.5) + uri (>= 0.13.1) addressable (2.9.0) public_suffix (>= 2.0.2, < 8.0) anonymous_loader (0.1.2) @@ -113,7 +111,6 @@ GEM rack-test (>= 0.6.3) regexp_parser (>= 1.5, < 3.0) xpath (~> 3.2) - cgi (0.5.2) chartkick (5.1.5) childprocess (5.1.0) logger (~> 1.5) @@ -152,7 +149,7 @@ GEM faraday-net_http (3.4.4) net-http (~> 0.5) ffi (1.17.2-x86_64-linux-gnu) - globalid (1.3.0) + globalid (1.4.0) activesupport (>= 6.1) groupdate (6.6.0) activesupport (>= 7.1) @@ -181,7 +178,7 @@ GEM jbuilder (2.13.0) actionview (>= 5.0.0) activesupport (>= 5.0.0) - json (2.20.0) + json (2.21.1) jwt (3.2.0) base64 kaminari (1.2.2) @@ -213,17 +210,19 @@ GEM loofah (2.25.1) crass (~> 1.0.2) nokogiri (>= 1.12.0) - mail (2.9.0) + mail (2.9.1) logger mini_mime (>= 0.1.1) net-imap net-pop net-smtp - marcel (1.1.0) + marcel (1.2.1) matrix (0.4.2) memory_profiler (1.1.0) mini_mime (1.1.5) - minitest (5.27.0) + minitest (6.0.6) + drb (~> 2.0) + prism (~> 1.5) msgpack (1.8.3) multi_xml (0.9.1) bigdecimal (>= 3.1, < 5) @@ -283,9 +282,6 @@ GEM prettyprint prettyprint (0.2.0) prism (1.9.0) - psych (5.4.0) - date - stringio public_suffix (7.0.5) puma (8.0.2) nio4r (~> 2.0) @@ -306,20 +302,20 @@ GEM rack (>= 1.3) rackup (2.3.1) rack (>= 3) - rails (7.2.3.1) - actioncable (= 7.2.3.1) - actionmailbox (= 7.2.3.1) - actionmailer (= 7.2.3.1) - actionpack (= 7.2.3.1) - actiontext (= 7.2.3.1) - actionview (= 7.2.3.1) - activejob (= 7.2.3.1) - activemodel (= 7.2.3.1) - activerecord (= 7.2.3.1) - activestorage (= 7.2.3.1) - activesupport (= 7.2.3.1) + rails (8.0.5) + actioncable (= 8.0.5) + actionmailbox (= 8.0.5) + actionmailer (= 8.0.5) + actionpack (= 8.0.5) + actiontext (= 8.0.5) + actionview (= 8.0.5) + activejob (= 8.0.5) + activemodel (= 8.0.5) + activerecord (= 8.0.5) + activestorage (= 8.0.5) + activesupport (= 8.0.5) bundler (>= 1.15.0) - railties (= 7.2.3.1) + railties (= 8.0.5) rails-dom-testing (2.3.0) activesupport (>= 5.0.0) minitest @@ -327,10 +323,9 @@ GEM rails-html-sanitizer (1.7.0) loofah (~> 2.25) nokogiri (>= 1.15.7, != 1.16.7, != 1.16.6, != 1.16.5, != 1.16.4, != 1.16.3, != 1.16.2, != 1.16.1, != 1.16.0.rc1, != 1.16.0) - railties (7.2.3.1) - actionpack (= 7.2.3.1) - activesupport (= 7.2.3.1) - cgi + railties (8.0.5) + actionpack (= 8.0.5) + activesupport (= 8.0.5) irb (~> 1.13) rackup (>= 1.0.0) rake (>= 12.2) @@ -339,9 +334,14 @@ GEM zeitwerk (~> 2.6) rainbow (3.1.1) rake (13.4.2) - rdoc (7.2.0) + rbs (4.0.3) + logger + prism (>= 1.6.0) + tsort + rdoc (8.0.0) erb - psych (>= 4.0.0) + prism (>= 1.6.0) + rbs (>= 4.0.0) tsort react-rails (3.2.1) babel-transpiler (>= 0.7.0) @@ -454,7 +454,6 @@ GEM stackprof (0.2.27) stimulus-rails (1.3.4) railties (>= 6.0.0) - stringio (3.2.0) temple (0.10.3) thor (1.5.0) tilt (2.7.0) @@ -521,7 +520,7 @@ DEPENDENCIES puma (>= 5.0) rack (>= 3.2.6) rack-mini-profiler - rails (~> 7.2.3, >= 7.2.3.1) + rails (~> 8.0.0) react-rails (~> 3.2) rspec-rails rubocop From 10558d52cd409d84a60e97c0604b8d2f3066e8e4 Mon Sep 17 00:00:00 2001 From: Ryan Turner <100864486+Turnlings@users.noreply.github.com> Date: Tue, 14 Jul 2026 18:56:59 +0100 Subject: [PATCH 2/3] fix: follow new rubocop rules --- app/controllers/exam_results_controller.rb | 2 +- app/controllers/exams_controller.rb | 2 +- app/controllers/semesters_controller.rb | 2 +- app/controllers/timelogs_controller.rb | 2 +- app/controllers/uni_module_targets_controller.rb | 2 +- app/controllers/uni_modules_controller.rb | 2 +- app/controllers/users_controller.rb | 4 ++-- app/controllers/years_controller.rb | 2 +- 8 files changed, 9 insertions(+), 9 deletions(-) diff --git a/app/controllers/exam_results_controller.rb b/app/controllers/exam_results_controller.rb index 7deaa20..1ac1105 100644 --- a/app/controllers/exam_results_controller.rb +++ b/app/controllers/exam_results_controller.rb @@ -51,6 +51,6 @@ def set_exam_result # Only allow a list of trusted parameters through. def exam_result_params - params.require(:exam_result).permit(:score, :exam_id, :user_id) + params.expect(exam_result: %i[score exam_id user_id]) end end diff --git a/app/controllers/exams_controller.rb b/app/controllers/exams_controller.rb index e5c85ca..9d35366 100644 --- a/app/controllers/exams_controller.rb +++ b/app/controllers/exams_controller.rb @@ -109,6 +109,6 @@ def set_exam # Only allow a list of trusted parameters through. def exam_params - params.require(:exam).permit(:weight, :name, :type, :uni_module_id, :due, :completed, :threshold, :released) + params.expect(exam: %i[weight name type uni_module_id due completed threshold released]) end end diff --git a/app/controllers/semesters_controller.rb b/app/controllers/semesters_controller.rb index 2a08658..bff7561 100644 --- a/app/controllers/semesters_controller.rb +++ b/app/controllers/semesters_controller.rb @@ -115,7 +115,7 @@ def set_semester # Only allow a list of trusted parameters through. def semester_params - params.require(:semester).permit(:name, :year_id, :final_score) + params.expect(semester: %i[name year_id final_score]) end def copy_semester(shared_semester, new_semester) diff --git a/app/controllers/timelogs_controller.rb b/app/controllers/timelogs_controller.rb index c012f17..dfd6d49 100644 --- a/app/controllers/timelogs_controller.rb +++ b/app/controllers/timelogs_controller.rb @@ -80,6 +80,6 @@ def set_timelog # Only allow a list of trusted parameters through. def timelog_params - params.require(:timelog).permit(:uni_module_id, :date, :minutes, :description) + params.expect(timelog: %i[uni_module_id date minutes description]) end end diff --git a/app/controllers/uni_module_targets_controller.rb b/app/controllers/uni_module_targets_controller.rb index 067ddb6..4f6c4be 100644 --- a/app/controllers/uni_module_targets_controller.rb +++ b/app/controllers/uni_module_targets_controller.rb @@ -32,6 +32,6 @@ def set_uni_module_target end def uni_module_target_params - params.require(:uni_module_target).permit(:score, :uni_module_id, :user_id) + params.expect(uni_module_target: %i[score uni_module_id user_id]) end end diff --git a/app/controllers/uni_modules_controller.rb b/app/controllers/uni_modules_controller.rb index c9c3fc8..480d9ef 100644 --- a/app/controllers/uni_modules_controller.rb +++ b/app/controllers/uni_modules_controller.rb @@ -104,6 +104,6 @@ def set_uni_module # Only allow a list of trusted parameters through. def uni_module_params - params.require(:uni_module).permit(:code, :name, :credits, :target, :final_score, :color, semester_ids: []) + params.expect(uni_module: [:code, :name, :credits, :target, :final_score, :color, { semester_ids: [] }]) end end diff --git a/app/controllers/users_controller.rb b/app/controllers/users_controller.rb index 6fdd37f..4f71e3f 100644 --- a/app/controllers/users_controller.rb +++ b/app/controllers/users_controller.rb @@ -53,7 +53,7 @@ def set_user # Only allow a list of trusted parameters through. def user_params - params.require(:user).permit(:email) + params.expect(user: [:email]) end def exam_data @@ -80,6 +80,6 @@ def normalize_logs(start_date) end def target_params - params.require(:user).permit(:target) + params.expect(user: [:target]) end end diff --git a/app/controllers/years_controller.rb b/app/controllers/years_controller.rb index 7230a5e..45ae306 100644 --- a/app/controllers/years_controller.rb +++ b/app/controllers/years_controller.rb @@ -63,6 +63,6 @@ def set_year # Only allow a list of trusted parameters through. def year_params - params.require(:year).permit(:name, :weighting, :final_score) + params.expect(year: %i[name weighting final_score]) end end From 073d2c4332c042eeede43d40244cbd3a8863bd9f Mon Sep 17 00:00:00 2001 From: Ryan Turner <100864486+Turnlings@users.noreply.github.com> Date: Tue, 14 Jul 2026 19:18:27 +0100 Subject: [PATCH 3/3] test: fix to fit expection conventions --- spec/requests/years_spec.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/spec/requests/years_spec.rb b/spec/requests/years_spec.rb index 8203806..bac6fb1 100644 --- a/spec/requests/years_spec.rb +++ b/spec/requests/years_spec.rb @@ -71,7 +71,7 @@ patch year_path(year), params: { year: { user_id: other_user.id } } - expect(response).to redirect_to(year_path(year)) + expect(response).to have_http_status(:bad_request) expect(year.reload.user).to eq(user) end end