From 066c30acd55a1b3d22018cf875a074899a99a904 Mon Sep 17 00:00:00 2001 From: Martin Mladenov <m.mladenov@student.tudelft.nl> Date: Wed, 11 Sep 2024 10:10:37 +0300 Subject: [PATCH 1/2] Update dependencies --- CHANGELOG_UNRELEASED.md | 2 +- Gemfile.lock | 86 ++++++++++++++++++++--------------------- 2 files changed, 44 insertions(+), 44 deletions(-) diff --git a/CHANGELOG_UNRELEASED.md b/CHANGELOG_UNRELEASED.md index ebab99bfa..a44db8469 100644 --- a/CHANGELOG_UNRELEASED.md +++ b/CHANGELOG_UNRELEASED.md @@ -16,7 +16,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/). ### Changed - +- [Dev] Updated dependencies (!1154) ### Removed diff --git a/Gemfile.lock b/Gemfile.lock index c6444a353..1522335e5 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -1,8 +1,8 @@ GIT remote: https://github.com/activerecord-hackery/ransack.git - revision: 87c89364cee668ea8d55e9a704a1dbd57d5cd7d7 + revision: 2d56e78f860bbceec9f52fa7ec5a0cce6bb0702b specs: - ransack (4.2.0) + ransack (4.2.1) activerecord (>= 6.1.5) activesupport (>= 6.1.5) i18n @@ -20,9 +20,9 @@ GIT GIT remote: https://github.com/zdennis/activerecord-import.git - revision: fca8b823ae695b03714837cc6603f51525c60505 + revision: 01cb6b9451b770e7a9dea0da5decbb3d30ca6cb5 specs: - activerecord-import (1.7.0) + activerecord-import (1.8.1) activerecord (>= 4.2) GIT @@ -120,7 +120,7 @@ GEM tzinfo (~> 2.0) addressable (2.8.7) public_suffix (>= 2.0.2, < 7.0) - airbrussh (1.5.2) + airbrussh (1.5.3) sshkit (>= 1.6.1, != 1.7.0) ansi (1.5.0) ast (2.4.2) @@ -146,12 +146,12 @@ GEM bootstrap_form (4.5.0) actionpack (>= 5.2) activemodel (>= 5.2) - brakeman (6.1.2) + brakeman (6.2.1) racc breadcrumbs_on_rails (4.1.0) railties (>= 5.0) builder (3.3.0) - bundler-audit (0.9.1) + bundler-audit (0.9.2) bundler (>= 1.2.0, < 3) thor (~> 1.0) byebug (11.1.3) @@ -161,7 +161,7 @@ GEM i18n rake (>= 10.0.0) sshkit (>= 1.9.0) - capistrano-bundler (2.1.0) + capistrano-bundler (2.1.1) capistrano (~> 3.1) capistrano-rails (1.6.3) capistrano (~> 3.1) @@ -186,7 +186,8 @@ GEM caxlsx_rails (0.6.4) actionpack (>= 3.1) caxlsx (>= 3.0) - childprocess (5.0.0) + childprocess (5.1.0) + logger (~> 1.5) choice (0.2.0) climate_control (1.2.0) cocoon (1.2.15) @@ -198,7 +199,7 @@ GEM coffee-script-source execjs coffee-script-source (1.12.2) - concurrent-ruby (1.3.3) + concurrent-ruby (1.3.4) connection_pool (2.4.1) crass (1.0.6) date (3.3.4) @@ -233,10 +234,10 @@ GEM execjs (2.9.1) faker (3.4.2) i18n (>= 1.8.11, < 2) - faraday (2.10.1) - faraday-net_http (>= 2.0, < 3.2) + faraday (2.11.0) + faraday-net_http (>= 2.0, < 3.4) logger - faraday-net_http (3.1.1) + faraday-net_http (3.3.0) net-http ffi (1.16.3) font-awesome-sass (6.5.2) @@ -250,7 +251,7 @@ GEM image_processing (1.13.0) mini_magick (>= 4.9.5, < 5) ruby-vips (>= 2.0.17, < 3) - inline_svg (1.9.0) + inline_svg (1.10.0) activesupport (>= 3.0) nokogiri (>= 1.6) jbuilder (2.12.0) @@ -289,17 +290,17 @@ GEM childprocess (~> 5.0) letter_opener (1.10.0) launchy (>= 2.2, < 4) - letter_opener_web (2.0.0) - actionmailer (>= 5.2) - letter_opener (~> 1.7) - railties (>= 5.2) + letter_opener_web (3.0.0) + actionmailer (>= 6.1) + letter_opener (~> 1.9) + railties (>= 6.1) rexml lightbox2-rails (2.8.2.1) railties (>= 3.1) listen (3.9.0) rb-fsevent (~> 0.10, >= 0.10.3) rb-inotify (~> 0.9, >= 0.9.10) - logger (1.6.0) + logger (1.6.1) loofah (2.22.0) crass (~> 1.0.2) nokogiri (>= 1.12.0) @@ -313,10 +314,10 @@ GEM method_source (1.1.0) mime-types (3.5.2) mime-types-data (~> 3.2015) - mime-types-data (3.2024.0702) + mime-types-data (3.2024.0903) mini_magick (4.13.2) mini_mime (1.1.5) - minitest (5.24.1) + minitest (5.25.1) minitest-reporters (1.7.1) ansi builder @@ -328,7 +329,7 @@ GEM mysql2 (0.5.6) net-http (0.4.1) uri - net-imap (0.4.14) + net-imap (0.4.16) date net-protocol net-ldap (0.19.0) @@ -349,12 +350,13 @@ GEM nokogiri (1.16.7-x86_64-linux) racc (~> 1.4) orm_adapter (0.5.0) + ostruct (0.6.0) pairing_heap (3.1.0) paper_trail (12.3.0) activerecord (>= 5.2) request_store (~> 1.1) - parallel (1.25.1) - parser (3.3.4.0) + parallel (1.26.3) + parser (3.3.5.0) ast (~> 2.4.1) racc passenger (6.0.22) @@ -417,35 +419,33 @@ GEM responders (3.1.1) actionpack (>= 5.2) railties (>= 5.2) - rexml (3.3.4) - strscan + rexml (3.3.7) rgl (0.5.10) pairing_heap (>= 0.3.0) rexml (~> 3.2, >= 3.2.4) stream (~> 0.5.3) rolify (6.0.1) - rubocop (1.65.1) + rubocop (1.66.1) json (~> 2.3) language_server-protocol (>= 3.17.0) parallel (~> 1.10) parser (>= 3.3.0.2) rainbow (>= 2.2.2, < 4.0) regexp_parser (>= 2.4, < 3.0) - rexml (>= 3.2.5, < 4.0) - rubocop-ast (>= 1.31.1, < 2.0) + rubocop-ast (>= 1.32.2, < 2.0) ruby-progressbar (~> 1.7) unicode-display_width (>= 2.4.0, < 3.0) - rubocop-ast (1.31.3) + rubocop-ast (1.32.3) parser (>= 3.3.1.0) - rubocop-rails (2.25.1) + rubocop-rails (2.26.1) activesupport (>= 4.2.0) rack (>= 1.1) - rubocop (>= 1.33.0, < 2.0) + rubocop (>= 1.52.0, < 2.0) rubocop-ast (>= 1.31.1, < 2.0) ruby-graphviz (1.2.5) rexml ruby-progressbar (1.13.0) - ruby-saml (1.16.0) + ruby-saml (1.17.0) nokogiri (>= 1.13.10) rexml ruby-vips (2.2.2) @@ -465,16 +465,16 @@ GEM tilt seedbank (0.5.0) rake (>= 10.0) - selenium-webdriver (4.23.0) + selenium-webdriver (4.24.0) base64 (~> 0.2) logger (~> 1.4) rexml (~> 3.2, >= 3.2.5) rubyzip (>= 1.2.2, < 3.0) websocket (~> 1.0) - sentry-rails (5.18.2) + sentry-rails (5.19.0) railties (>= 5.0) - sentry-ruby (~> 5.18.2) - sentry-ruby (5.18.2) + sentry-ruby (~> 5.19.0) + sentry-ruby (5.19.0) bigdecimal concurrent-ruby (~> 1.0, >= 1.0.2) simplecov (0.22.0) @@ -484,7 +484,7 @@ GEM simplecov-cobertura (2.1.0) rexml simplecov (~> 0.19) - simplecov-html (0.12.3) + simplecov-html (0.13.1) simplecov_json_formatter (0.1.4) smart_properties (1.17.0) sprockets (4.2.1) @@ -496,18 +496,18 @@ GEM sprockets (>= 3.0.0) sqlite3 (1.7.3-arm64-darwin) sqlite3 (1.7.3-x86_64-linux) - sshkit (1.23.0) + sshkit (1.23.1) base64 net-scp (>= 1.1.2) net-sftp (>= 2.1.2) net-ssh (>= 2.8.0) + ostruct stream (0.5.5) - strscan (3.1.0) terrapin (1.0.1) climate_control terser (1.2.3) execjs (>= 0.3.0, < 3) - thor (1.3.1) + thor (1.3.2) tilt (2.4.0) timeout (0.4.1) turbolinks (5.2.1) @@ -516,7 +516,7 @@ GEM tzinfo (2.0.6) concurrent-ruby (~> 1.0) unicode-display_width (2.5.0) - uri (0.13.0) + uri (0.13.1) warden (1.2.9) rack (>= 2.0.9) web-console (4.2.1) @@ -533,7 +533,7 @@ GEM zebra-datepicker-rails (1.9.7) railties (>= 3.0) sass-rails - zeitwerk (2.6.17) + zeitwerk (2.6.18) zip-zip (0.3) rubyzip (>= 1.0.0) -- GitLab From b6477b39f82c762b38378c6d3227ce2cff868264 Mon Sep 17 00:00:00 2001 From: Martin Mladenov <m.mladenov@student.tudelft.nl> Date: Wed, 11 Sep 2024 10:13:15 +0300 Subject: [PATCH 2/2] The linter is hungry again --- app/models/attachment.rb | 2 +- app/models/company.rb | 2 +- app/models/concerns/importable.rb | 4 ++-- app/models/concerns/user_concerns/authenticatable.rb | 2 +- app/models/concerns/user_concerns/roleable.rb | 8 ++++---- app/models/course_configuration.rb | 8 ++++---- app/models/course_edition.rb | 4 ++-- app/models/course_participation.rb | 2 +- app/models/course_specific_role.rb | 4 ++-- app/models/group.rb | 4 ++-- app/models/import.rb | 2 +- app/models/membership.rb | 4 ++-- app/models/note.rb | 2 +- app/models/project.rb | 2 +- app/models/project_interest.rb | 2 +- app/models/role_invitation.rb | 2 +- 16 files changed, 27 insertions(+), 27 deletions(-) diff --git a/app/models/attachment.rb b/app/models/attachment.rb index 221347ee3..cecbdd12c 100644 --- a/app/models/attachment.rb +++ b/app/models/attachment.rb @@ -2,7 +2,7 @@ class Attachment < ApplicationRecord belongs_to :user belongs_to :group - enum file_type: { other: 0, contract: 1, report: 2, poster: 3 } + enum :file_type, { other: 0, contract: 1, report: 2, poster: 3 } has_attached_file \ :file, diff --git a/app/models/company.rb b/app/models/company.rb index b9cd2729b..2d384c420 100644 --- a/app/models/company.rb +++ b/app/models/company.rb @@ -14,7 +14,7 @@ class Company < ApplicationRecord has_many :company_user_email_suffixes, inverse_of: :company, dependent: :destroy accepts_nested_attributes_for :company_user_email_suffixes, allow_destroy: true - enum affiliation: { external: 0, internal: 1 } + enum :affiliation, { external: 0, internal: 1 } def self.ransackable_attributes(_auth_object = nil) %w[id name city] diff --git a/app/models/concerns/importable.rb b/app/models/concerns/importable.rb index 0a00f4452..5c9c0ce8c 100644 --- a/app/models/concerns/importable.rb +++ b/app/models/concerns/importable.rb @@ -4,8 +4,8 @@ module Importable included do belongs_to :course_edition - enum participation_status: { pending: 0, approved: 1, rejected: 2 } + enum :participation_status, { pending: 0, approved: 1, rejected: 2 } - enum user_identifier_type: { email: 0, student_number: 1, netid: 2 } + enum :user_identifier_type, { email: 0, student_number: 1, netid: 2 } end end diff --git a/app/models/concerns/user_concerns/authenticatable.rb b/app/models/concerns/user_concerns/authenticatable.rb index ef179a2e8..3ccb9c04d 100644 --- a/app/models/concerns/user_concerns/authenticatable.rb +++ b/app/models/concerns/user_concerns/authenticatable.rb @@ -9,7 +9,7 @@ module UserConcerns before_validation :prepare_internal, if: -> { from_sso? || from_ldap? } - enum created_via: { from_sso: 0, from_front: 1, from_admin: 2, from_ldap: 3 } + enum :created_via, { from_sso: 0, from_front: 1, from_admin: 2, from_ldap: 3 } has_one :sso_profile, dependent: :destroy accepts_nested_attributes_for :sso_profile diff --git a/app/models/concerns/user_concerns/roleable.rb b/app/models/concerns/user_concerns/roleable.rb index 0077fcf2c..f74a8ba20 100644 --- a/app/models/concerns/user_concerns/roleable.rb +++ b/app/models/concerns/user_concerns/roleable.rb @@ -8,9 +8,9 @@ module UserConcerns included do rolify before_add: :delete_role_invitations_for - enum affiliation: { external: 0, internal: 1 } - enum role: { role_company: 0, role_student: 1, role_staff: 2, role_admin: 3 } - enum student_type: { regular: 0, tnw_double_bachelor: 1, tnw_1_bridging: 2, tnw_2_bridging: 3 } + enum :affiliation, { external: 0, internal: 1 } + enum :role, { role_company: 0, role_student: 1, role_staff: 2, role_admin: 3 } + enum :student_type, { regular: 0, tnw_double_bachelor: 1, tnw_1_bridging: 2, tnw_2_bridging: 3 } has_many :users_roles, dependent: :delete_all @@ -19,7 +19,7 @@ module UserConcerns validate :external_cannot_get_higher_authorization_level - enum authorization_level: { default: 0, staff: 1, admin: 2 } + enum :authorization_level, { default: 0, staff: 1, admin: 2 } after_initialize :auto_set_authorization_level, if: :new_record? before_create :auto_set_authorization_level diff --git a/app/models/course_configuration.rb b/app/models/course_configuration.rb index 5d0d0adff..6e40991c1 100644 --- a/app/models/course_configuration.rb +++ b/app/models/course_configuration.rb @@ -1,11 +1,11 @@ class CourseConfiguration < ApplicationRecord belongs_to :course_edition, inverse_of: :configuration - enum workflow: { default_workflow: 0, thesis_workflow: 1, experiment_workflow: 2, choice_workflow: 3 } - enum cleanup_after_approval: { disabled: 0, client: 1, coordinator: 2 }, _prefix: :cleanup_after_approval - enum enrolment_type: { enrolment_with_declaration: 0, open_enrolment: 1, auto_approve_enrolment: 2, + enum :workflow, { default_workflow: 0, thesis_workflow: 1, experiment_workflow: 2, choice_workflow: 3 } + enum :cleanup_after_approval, { disabled: 0, client: 1, coordinator: 2 }, prefix: :cleanup_after_approval + enum :enrolment_type, { enrolment_with_declaration: 0, open_enrolment: 1, auto_approve_enrolment: 2, enrolment_with_request_form: 3 } - enum pending_enrolment_access: { pending_no_access: 0, pending_see_projects: 1, pending_see_projects_and_express_interest: 2 } + enum :pending_enrolment_access, { pending_no_access: 0, pending_see_projects: 1, pending_see_projects_and_express_interest: 2 } validates :project_name, inclusion: { in: I18n.t('configurable').keys.map(&:to_s), diff --git a/app/models/course_edition.rb b/app/models/course_edition.rb index 4977d77a5..900b2a053 100644 --- a/app/models/course_edition.rb +++ b/app/models/course_edition.rb @@ -42,7 +42,7 @@ class CourseEdition < ApplicationRecord has_many :imports, dependent: :destroy - enum status: { hidden: 0, normal: 1 } + enum :status, { hidden: 0, normal: 1 } # ===== Participations ===== # These two are the same relation, but if the top one is not there it breaks some others. @@ -551,7 +551,7 @@ class CourseEdition < ApplicationRecord def active_reason return :hidden, nil unless normal? - start_date = [enrolment_starts_at, offering_projects_starts_at, starts_at].select(&:present?).min + start_date = [enrolment_starts_at, offering_projects_starts_at, starts_at].compact_blank.min return :future, start_date if !start_date.nil? && start_date > Date.current return :past, ends_at if !ends_at.nil? && ends_at < Date.current diff --git a/app/models/course_participation.rb b/app/models/course_participation.rb index c485d0f70..6c3bb272e 100644 --- a/app/models/course_participation.rb +++ b/app/models/course_participation.rb @@ -14,7 +14,7 @@ class CourseParticipation < ApplicationRecord has_many :import_entries, dependent: :nullify - enum status: { pending: 0, approved: 1, rejected: 2 } + enum :status, { pending: 0, approved: 1, rejected: 2 } validates :user_id, uniqueness: { scope: :course_edition_id } validates :status, presence: true diff --git a/app/models/course_specific_role.rb b/app/models/course_specific_role.rb index ffd521bb1..061cd44c4 100644 --- a/app/models/course_specific_role.rb +++ b/app/models/course_specific_role.rb @@ -1,8 +1,8 @@ class CourseSpecificRole < ApplicationRecord belongs_to :course_edition, inverse_of: :course_specific_roles - enum role_type: { coach: 0, client: 1 } - enum assignment_rule: { not_specifiable_by_client: 0, required: 1, optional: 2 } + enum :role_type, { coach: 0, client: 1 } + enum :assignment_rule, { not_specifiable_by_client: 0, required: 1, optional: 2 } has_many :user_course_specific_roles, inverse_of: :course_specific_role, dependent: :destroy has_many :users, through: :user_course_specific_roles diff --git a/app/models/group.rb b/app/models/group.rb index 6e8ab4d55..775db4446 100644 --- a/app/models/group.rb +++ b/app/models/group.rb @@ -35,8 +35,8 @@ class Group < ApplicationRecord has_many :user_course_specific_roles, as: :resource, dependent: :destroy - enum status: { open: 0, locked: 1, approved: 2, rejected: 3 } - enum client_status: { client_pending: 0, client_approved: 1, client_rejected: 2 } + enum :status, { open: 0, locked: 1, approved: 2, rejected: 3 } + enum :client_status, { client_pending: 0, client_approved: 1, client_rejected: 2 } scope :status_updateable, -> { open.or(locked) } diff --git a/app/models/import.rb b/app/models/import.rb index 355683e91..b390cc3be 100644 --- a/app/models/import.rb +++ b/app/models/import.rb @@ -17,7 +17,7 @@ class Import < ApplicationRecord belongs_to :course_edition - enum status: { uploaded: 0, analysed: 1, activated: 2 } + enum :status, { uploaded: 0, analysed: 1, activated: 2 } step_tracked_by :status aasm :status, column: :status, enum: true do diff --git a/app/models/membership.rb b/app/models/membership.rb index bfd82c976..4a30a0141 100644 --- a/app/models/membership.rb +++ b/app/models/membership.rb @@ -3,8 +3,8 @@ class Membership < ApplicationRecord belongs_to :user belongs_to :group - enum role: { leader: 0, member: 1 } - enum status: { invited: 0, requested: 1, joined: 2, commit: 3 } + enum :role, { leader: 0, member: 1 } + enum :status, { invited: 0, requested: 1, joined: 2, commit: 3 } # Property used to appoint the group successor in case the leader leaves attr_accessor :successor_id diff --git a/app/models/note.rb b/app/models/note.rb index 5fd10c0c9..ec577f507 100644 --- a/app/models/note.rb +++ b/app/models/note.rb @@ -2,5 +2,5 @@ class Note < ApplicationRecord belongs_to :user belongs_to :group - enum access_level: { group_members: 0, staff: 1, admin: 2 } + enum :access_level, { group_members: 0, staff: 1, admin: 2 } end diff --git a/app/models/project.rb b/app/models/project.rb index 4f23e4321..75b56e0b6 100644 --- a/app/models/project.rb +++ b/app/models/project.rb @@ -112,7 +112,7 @@ class Project < ApplicationRecord # ===== Statuses ===== - enum status: { pending: 0, approved: 1, rejected: 2, update_rejected: 3, updated: 4, deactivated: 5, changes_requested: 6, + enum :status, { pending: 0, approved: 1, rejected: 2, update_rejected: 3, updated: 4, deactivated: 5, changes_requested: 6, approved_awaiting_client_confirmation: 7 } # Before updating, if the status changed to approved, set approved_at diff --git a/app/models/project_interest.rb b/app/models/project_interest.rb index b66b1fb51..d483752ff 100644 --- a/app/models/project_interest.rb +++ b/app/models/project_interest.rb @@ -2,7 +2,7 @@ class ProjectInterest < ApplicationRecord belongs_to :project belongs_to :user - enum interest_type: { student: 0, coach: 1 } + enum :interest_type, { student: 0, coach: 1 } has_one :course_edition, through: :project diff --git a/app/models/role_invitation.rb b/app/models/role_invitation.rb index f6cd465f2..a90c02f75 100644 --- a/app/models/role_invitation.rb +++ b/app/models/role_invitation.rb @@ -9,7 +9,7 @@ class RoleInvitation < ApplicationRecord polymorphic: true, optional: true - enum status: { pending: 0, approved: 1, rejected: 2 } + enum :status, { pending: 0, approved: 1, rejected: 2 } # =========================================================================== # Validations -- GitLab