diff --git a/Gemfile b/Gemfile index 991498029..98479cd34 100644 --- a/Gemfile +++ b/Gemfile @@ -44,7 +44,7 @@ gem "view_component", "~> 3.9" # Use the AWS S3 SDK as storage mechanism gem "aws-sdk-s3" # Track changes to models for auditing or versioning. -gem "paper_trail" +gem "paper_trail", "~> 15.2" # Store active record objects in version whodunnits gem "paper_trail-globalid" diff --git a/Gemfile.lock b/Gemfile.lock index 088d33d8a..41bdc3077 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -301,7 +301,7 @@ GEM iniparse (~> 1.4) rexml (~> 3.2) pagy (9.3.2) - paper_trail (15.1.0) + paper_trail (15.2.0) activerecord (>= 6.1) request_store (~> 1.4) paper_trail-globalid (0.2.0) @@ -397,7 +397,7 @@ GEM regexp_parser (2.9.0) reline (0.5.12) io-console (~> 0.5) - request_store (1.6.0) + request_store (1.7.0) rack (>= 1.4) responders (3.1.1) actionpack (>= 5.2) @@ -569,7 +569,7 @@ DEPENDENCIES method_source (~> 1.1) notifications-ruby-client overcommit (>= 0.37.0) - paper_trail + paper_trail (~> 15.2) paper_trail-globalid parallel_tests pg (~> 1.1) diff --git a/app/models/scheme.rb b/app/models/scheme.rb index 97f188c99..ae772b30b 100644 --- a/app/models/scheme.rb +++ b/app/models/scheme.rb @@ -145,7 +145,7 @@ class Scheme < ApplicationRecord Yes: 1, }.freeze - enum :sensitive, SENSITIVE, _suffix: true + enum :sensitive, SENSITIVE, suffix: true REGISTERED_UNDER_CARE_ACT = { "Yes – registered care home providing nursing care": 4, @@ -164,7 +164,7 @@ class Scheme < ApplicationRecord "Missing": 0, }.freeze - enum :scheme_type, SCHEME_TYPE, _suffix: true + enum :scheme_type, SCHEME_TYPE, suffix: true SUPPORT_TYPE = { "Missing": 0, @@ -175,7 +175,7 @@ class Scheme < ApplicationRecord "Floating support": 6, }.freeze - enum :support_type, SUPPORT_TYPE, _suffix: true + enum :support_type, SUPPORT_TYPE, suffix: true PRIMARY_CLIENT_GROUP = { "Homeless families with support needs": "O", @@ -197,8 +197,8 @@ class Scheme < ApplicationRecord "Missing": "X", }.freeze - enum :primary_client_group, PRIMARY_CLIENT_GROUP, _suffix: true - enum :secondary_client_group, PRIMARY_CLIENT_GROUP, _suffix: true + enum :primary_client_group, PRIMARY_CLIENT_GROUP, suffix: true + enum :secondary_client_group, PRIMARY_CLIENT_GROUP, suffix: true INTENDED_STAY = { "Very short stay": "V", @@ -213,8 +213,8 @@ class Scheme < ApplicationRecord Yes: 1, }.freeze - enum :intended_stay, INTENDED_STAY, _suffix: true - enum :has_other_client_group, HAS_OTHER_CLIENT_GROUP, _suffix: true + enum :intended_stay, INTENDED_STAY, suffix: true + enum :has_other_client_group, HAS_OTHER_CLIENT_GROUP, suffix: true ARRANGEMENT_TYPE = { "The same organisation that owns the housing stock": "D", @@ -226,7 +226,7 @@ class Scheme < ApplicationRecord DUPLICATE_SCHEME_ATTRIBUTES = %w[scheme_type registered_under_care_act primary_client_group secondary_client_group has_other_client_group support_type intended_stay].freeze - enum :arrangement_type, ARRANGEMENT_TYPE, _suffix: true + enum :arrangement_type, ARRANGEMENT_TYPE, suffix: true def self.find_by_id_on_multiple_fields(scheme_id, location_id) return if scheme_id.nil? diff --git a/config/locales/en.yml b/config/locales/en.yml index 965c1f7a6..7a95aa6fd 100644 --- a/config/locales/en.yml +++ b/config/locales/en.yml @@ -382,6 +382,10 @@ en: organisation_part_of_another_merge: "This organisation is part of another merge - select a different one." organisation_part_of_another_incomplete_merge: "Another merge request records %{organisation} as merging into %{absorbing_organisation} on %{merge_date}. Select another organisation or remove this organisation from the other merge request." organisation_not_selected: "Select an organisation from the search list." + merge_request_id: + blank: "Select a merge request." + merging_organisation_id: + blank: "Select an organisation to merge." soft_validations: retirement: diff --git a/db/migrate/20241206142943_create_active_storage_variant_records.active_storage.rb b/db/migrate/20241206142943_create_active_storage_variant_records.active_storage.rb index 2d2c76b31..78b8564cf 100644 --- a/db/migrate/20241206142943_create_active_storage_variant_records.active_storage.rb +++ b/db/migrate/20241206142943_create_active_storage_variant_records.active_storage.rb @@ -13,16 +13,16 @@ class CreateActiveStorageVariantRecords < ActiveRecord::Migration[6.0] end end - private +private - def primary_key_type - config = Rails.configuration.generators - config.options[config.orm][:primary_key_type] || :primary_key - end + def primary_key_type + config = Rails.configuration.generators + config.options[config.orm][:primary_key_type] || :primary_key + end - def blobs_primary_key_type - pkey_name = connection.primary_key(:active_storage_blobs) - pkey_column = connection.columns(:active_storage_blobs).find { |c| c.name == pkey_name } - pkey_column.bigint? ? :bigint : pkey_column.type - end + def blobs_primary_key_type + pkey_name = connection.primary_key(:active_storage_blobs) + pkey_column = connection.columns(:active_storage_blobs).find { |c| c.name == pkey_name } + pkey_column.bigint? ? :bigint : pkey_column.type + end end diff --git a/db/seeds.rb b/db/seeds.rb index 9577c9105..f3dcb688d 100644 --- a/db/seeds.rb +++ b/db/seeds.rb @@ -12,11 +12,11 @@ def find_or_create_user(organisation, email, name, role) end end - if LocalAuthority.count.zero? - la_path = "config/local_authorities_data/initial_local_authorities.csv" - service = Imports::LocalAuthoritiesService.new(path: la_path) - service.call - end +if LocalAuthority.count.zero? + la_path = "config/local_authorities_data/initial_local_authorities.csv" + service = Imports::LocalAuthoritiesService.new(path: la_path) + service.call +end unless Rails.env.test? if LaRentRange.count.zero?