From 19902f46bf565d93ffc3b0e1c9ca0bdb7c27399e Mon Sep 17 00:00:00 2001 From: Paul Chavard Date: Wed, 2 Aug 2023 11:11:36 +0200 Subject: [PATCH 1/3] chore(annotate): remove annotate gem --- Gemfile | 1 - Gemfile.lock | 4 -- lib/tasks/auto_annotate_models.rake | 59 ----------------------------- 3 files changed, 64 deletions(-) delete mode 100644 lib/tasks/auto_annotate_models.rake diff --git a/Gemfile b/Gemfile index 2cc337335..ea24566ab 100644 --- a/Gemfile +++ b/Gemfile @@ -114,7 +114,6 @@ group :test do end group :development do - gem 'annotate' gem 'brakeman', require: false gem 'haml-lint' gem 'letter_opener_web' diff --git a/Gemfile.lock b/Gemfile.lock index d6e81d6e9..cc46335aa 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -101,9 +101,6 @@ GEM aes_key_wrap (1.1.0) after_party (1.11.2) anchored (1.1.0) - annotate (3.2.0) - activerecord (>= 3.2, < 8.0) - rake (>= 10.4, < 14.0) ast (2.4.2) attr_required (1.0.1) axe-core-api (4.2.1) @@ -813,7 +810,6 @@ DEPENDENCIES administrate-field-enum after_party anchored - annotate axe-core-rspec bcrypt bootsnap (>= 1.4.4) diff --git a/lib/tasks/auto_annotate_models.rake b/lib/tasks/auto_annotate_models.rake deleted file mode 100644 index c972ee747..000000000 --- a/lib/tasks/auto_annotate_models.rake +++ /dev/null @@ -1,59 +0,0 @@ -# NOTE: only doing this in development as some production environments (Heroku) -# NOTE: are sensitive to local FS writes, and besides -- it's just not proper -# NOTE: to have a dev-mode tool do its thing in production. -if Rails.env.development? - require 'annotate' - task :set_annotation_options do - # You can override any of these by setting an environment variable of the - # same name. - Annotate.set_defaults( - 'active_admin' => 'false', - 'additional_file_patterns' => [], - 'routes' => 'false', - 'models' => 'true', - 'position_in_routes' => 'before', - 'position_in_class' => 'before', - 'position_in_test' => 'before', - 'position_in_fixture' => 'before', - 'position_in_factory' => 'before', - 'position_in_serializer' => 'before', - 'show_foreign_keys' => 'false', - 'show_complete_foreign_keys' => 'false', - 'show_indexes' => 'false', - 'simple_indexes' => 'false', - 'model_dir' => 'app/models', - 'root_dir' => '', - 'include_version' => 'false', - 'require' => '', - 'exclude_tests' => 'true', - 'exclude_fixtures' => 'true', - 'exclude_factories' => 'true', - 'exclude_serializers' => 'true', - 'exclude_scaffolds' => 'true', - 'exclude_controllers' => 'true', - 'exclude_helpers' => 'true', - 'exclude_sti_subclasses' => 'false', - 'ignore_model_sub_dir' => 'false', - 'ignore_columns' => nil, - 'ignore_routes' => nil, - 'ignore_unknown_models' => 'true', - 'hide_limit_column_types' => 'integer,bigint,boolean', - 'hide_default_column_types' => 'json,jsonb,hstore', - 'skip_on_db_migrate' => 'false', - 'format_bare' => 'true', - 'format_rdoc' => 'false', - 'format_yard' => 'false', - 'format_markdown' => 'false', - 'sort' => 'false', - 'force' => 'false', - 'frozen' => 'false', - 'classified_sort' => 'true', - 'trace' => 'false', - 'wrapper_open' => nil, - 'wrapper_close' => nil, - 'with_comment' => 'true' - ) - end - - Annotate.load_tasks -end From 0f6188a542e7eb367d9261ec33b4c1394c2e2891 Mon Sep 17 00:00:00 2001 From: Paul Chavard Date: Wed, 2 Aug 2023 11:12:57 +0200 Subject: [PATCH 2/3] chore(annotate): remove model comments --- app/models/administrateur.rb | 9 --- app/models/administrateurs_instructeur.rb | 9 --- app/models/administrateurs_procedure.rb | 10 --- app/models/api_token.rb | 14 ---- app/models/archive.rb | 11 ---- app/models/assign_to.rb | 16 ----- app/models/attestation.rb | 10 --- app/models/attestation_template.rb | 13 ---- app/models/avis.rb | 20 ------ app/models/batch_operation.rb | 17 ----- app/models/bill_signature.rb | 9 --- app/models/bulk_message.rb | 13 ---- app/models/champ.rb | 22 ------- app/models/champs/address_champ.rb | 22 ------- app/models/champs/annuaire_education_champ.rb | 22 ------- app/models/champs/boolean_champ.rb | 22 ------- app/models/champs/carte_champ.rb | 22 ------- app/models/champs/checkbox_champ.rb | 22 ------- app/models/champs/civilite_champ.rb | 22 ------- app/models/champs/cnaf_champ.rb | 22 ------- app/models/champs/commune_champ.rb | 22 ------- app/models/champs/date_champ.rb | 22 ------- app/models/champs/datetime_champ.rb | 22 ------- app/models/champs/decimal_number_champ.rb | 22 ------- app/models/champs/departement_champ.rb | 22 ------- app/models/champs/dgfip_champ.rb | 22 ------- app/models/champs/dossier_link_champ.rb | 22 ------- app/models/champs/drop_down_list_champ.rb | 22 ------- app/models/champs/email_champ.rb | 22 ------- app/models/champs/epci_champ.rb | 22 ------- app/models/champs/explication_champ.rb | 22 ------- app/models/champs/header_section_champ.rb | 22 ------- app/models/champs/iban_champ.rb | 22 ------- app/models/champs/integer_number_champ.rb | 22 ------- .../champs/linked_drop_down_list_champ.rb | 22 ------- app/models/champs/mesri_champ.rb | 22 ------- .../champs/multiple_drop_down_list_champ.rb | 22 ------- app/models/champs/number_champ.rb | 22 ------- app/models/champs/pays_champ.rb | 22 ------- app/models/champs/phone_champ.rb | 22 ------- .../champs/piece_justificative_champ.rb | 22 ------- app/models/champs/pole_emploi_champ.rb | 22 ------- app/models/champs/region_champ.rb | 22 ------- app/models/champs/repetition_champ.rb | 22 ------- app/models/champs/rna_champ.rb | 22 ------- app/models/champs/siret_champ.rb | 22 ------- app/models/champs/text_champ.rb | 22 ------- app/models/champs/textarea_champ.rb | 22 ------- app/models/champs/titre_identite_champ.rb | 22 ------- app/models/champs/yes_no_champ.rb | 22 ------- app/models/commentaire.rb | 14 ---- app/models/deleted_dossier.rb | 16 ----- app/models/dossier.rb | 51 -------------- app/models/dossier_assignment.rb | 14 ---- app/models/dossier_batch_operation.rb | 11 ---- app/models/dossier_correction.rb | 12 ---- app/models/dossier_operation_log.rb | 16 ----- app/models/dossier_submitted_message.rb | 9 --- app/models/dossier_transfer.rb | 9 --- app/models/dossier_transfer_log.rb | 11 ---- app/models/email_event.rb | 14 ---- app/models/etablissement.rb | 49 -------------- app/models/exercice.rb | 13 ---- app/models/expert.rb | 9 --- app/models/experts_procedure.rb | 12 ---- app/models/export.rb | 15 ----- app/models/follow.rb | 15 ----- app/models/france_connect_information.rb | 19 ------ app/models/geo_area.rb | 13 ---- app/models/groupe_instructeur.rb | 12 ---- app/models/individual.rb | 13 ---- app/models/instructeur.rb | 13 ---- app/models/invite.rb | 13 ---- app/models/merge_log.rb | 11 ---- app/models/module_api_carto.rb | 13 ---- app/models/procedure.rb | 66 ------------------- app/models/procedure_presentation.rb | 12 ---- app/models/procedure_revision.rb | 13 ---- .../procedure_revision_type_de_champ.rb | 12 ---- app/models/safe_mailer.rb | 9 --- app/models/service.rb | 20 ------ app/models/stat.rb | 18 ----- app/models/super_admin.rb | 27 -------- app/models/targeted_user_link.rb | 12 ---- app/models/traitement.rb | 13 ---- app/models/trusted_device_token.rb | 10 --- app/models/type_de_champ.rb | 16 ----- app/models/user.rb | 32 --------- app/models/zone.rb | 11 ---- app/models/zone_label.rb | 11 ---- 90 files changed, 1666 deletions(-) diff --git a/app/models/administrateur.rb b/app/models/administrateur.rb index 819f9a15c..d8e069e16 100644 --- a/app/models/administrateur.rb +++ b/app/models/administrateur.rb @@ -1,12 +1,3 @@ -# == Schema Information -# -# Table name: administrateurs -# -# id :integer not null, primary key -# created_at :datetime -# updated_at :datetime -# user_id :bigint not null -# class Administrateur < ApplicationRecord UNUSED_ADMIN_THRESHOLD = ENV.fetch('UNUSED_ADMIN_THRESHOLD') { 6 }.to_i.months diff --git a/app/models/administrateurs_instructeur.rb b/app/models/administrateurs_instructeur.rb index f885c14ee..099f1bbc9 100644 --- a/app/models/administrateurs_instructeur.rb +++ b/app/models/administrateurs_instructeur.rb @@ -1,12 +1,3 @@ -# == Schema Information -# -# Table name: administrateurs_instructeurs -# -# created_at :datetime -# updated_at :datetime -# administrateur_id :integer not null -# instructeur_id :integer not null -# class AdministrateursInstructeur < ApplicationRecord belongs_to :administrateur belongs_to :instructeur diff --git a/app/models/administrateurs_procedure.rb b/app/models/administrateurs_procedure.rb index 1fd2002dc..084a18781 100644 --- a/app/models/administrateurs_procedure.rb +++ b/app/models/administrateurs_procedure.rb @@ -1,13 +1,3 @@ -# == Schema Information -# -# Table name: administrateurs_procedures -# -# manager :boolean -# created_at :datetime not null -# updated_at :datetime not null -# administrateur_id :bigint not null -# procedure_id :bigint not null -# class AdministrateursProcedure < ApplicationRecord belongs_to :administrateur belongs_to :procedure diff --git a/app/models/api_token.rb b/app/models/api_token.rb index a0e4a3ae5..4616969b8 100644 --- a/app/models/api_token.rb +++ b/app/models/api_token.rb @@ -1,17 +1,3 @@ -# == Schema Information -# -# Table name: api_tokens -# -# id :uuid not null, primary key -# allowed_procedure_ids :bigint is an Array -# encrypted_token :string not null -# name :string not null -# write_access :boolean default(TRUE), not null -# version :integer default(3), not null -# created_at :datetime not null -# updated_at :datetime not null -# administrateur_id :bigint not null -# class APIToken < ApplicationRecord include ActiveRecord::SecureToken diff --git a/app/models/archive.rb b/app/models/archive.rb index 0c7bd17cf..87eb4e461 100644 --- a/app/models/archive.rb +++ b/app/models/archive.rb @@ -1,15 +1,4 @@ # == Schema Information -# -# Table name: archives -# -# id :bigint not null, primary key -# job_status :string not null -# key :text not null -# month :date -# time_span_type :string not null -# created_at :datetime not null -# updated_at :datetime not null -# class Archive < ApplicationRecord include TransientModelsWithPurgeableJobConcern diff --git a/app/models/assign_to.rb b/app/models/assign_to.rb index d49462b68..a2f178235 100644 --- a/app/models/assign_to.rb +++ b/app/models/assign_to.rb @@ -1,19 +1,3 @@ -# == Schema Information -# -# Table name: assign_tos -# -# id :integer not null, primary key -# daily_email_notifications_enabled :boolean default(FALSE), not null -# instant_email_dossier_notifications_enabled :boolean default(FALSE), not null -# instant_email_message_notifications_enabled :boolean default(FALSE), not null -# instant_expert_avis_email_notifications_enabled :boolean default(FALSE) -# manager :boolean default(FALSE) -# weekly_email_notifications_enabled :boolean default(TRUE), not null -# created_at :datetime -# updated_at :datetime -# groupe_instructeur_id :bigint -# instructeur_id :integer -# class AssignTo < ApplicationRecord belongs_to :instructeur, optional: false belongs_to :groupe_instructeur, optional: false diff --git a/app/models/attestation.rb b/app/models/attestation.rb index 9964a5f7a..1bb486633 100644 --- a/app/models/attestation.rb +++ b/app/models/attestation.rb @@ -1,13 +1,3 @@ -# == Schema Information -# -# Table name: attestations -# -# id :integer not null, primary key -# title :string -# created_at :datetime not null -# updated_at :datetime not null -# dossier_id :integer not null -# class Attestation < ApplicationRecord belongs_to :dossier, optional: false diff --git a/app/models/attestation_template.rb b/app/models/attestation_template.rb index 63c6b1cb4..8b1e9d792 100644 --- a/app/models/attestation_template.rb +++ b/app/models/attestation_template.rb @@ -1,16 +1,3 @@ -# == Schema Information -# -# Table name: attestation_templates -# -# id :integer not null, primary key -# activated :boolean -# body :text -# footer :text -# title :text -# created_at :datetime not null -# updated_at :datetime not null -# procedure_id :integer -# class AttestationTemplate < ApplicationRecord include ActionView::Helpers::NumberHelper include TagsSubstitutionConcern diff --git a/app/models/avis.rb b/app/models/avis.rb index 2cc17d25b..c8d3790d0 100644 --- a/app/models/avis.rb +++ b/app/models/avis.rb @@ -1,23 +1,3 @@ -# == Schema Information -# -# Table name: avis -# -# id :integer not null, primary key -# answer :text -# claimant_type :string -# confidentiel :boolean default(FALSE), not null -# email :string -# introduction :text -# question_answer :boolean -# question_label :string -# reminded_at :datetime -# revoked_at :datetime -# created_at :datetime not null -# updated_at :datetime not null -# claimant_id :integer not null -# dossier_id :integer -# experts_procedure_id :bigint -# class Avis < ApplicationRecord include EmailSanitizableConcern diff --git a/app/models/batch_operation.rb b/app/models/batch_operation.rb index 4c3e4e345..c1da424c3 100644 --- a/app/models/batch_operation.rb +++ b/app/models/batch_operation.rb @@ -1,20 +1,3 @@ -# == Schema Information -# -# Table name: batch_operations -# -# id :bigint not null, primary key -# failed_dossier_ids :bigint default([]), not null, is an Array -# finished_at :datetime -# operation :string not null -# payload :jsonb not null -# run_at :datetime -# seen_at :datetime -# success_dossier_ids :bigint default([]), not null, is an Array -# created_at :datetime not null -# updated_at :datetime not null -# instructeur_id :bigint not null -# - class BatchOperation < ApplicationRecord enum operation: { accepter: 'accepter', diff --git a/app/models/bill_signature.rb b/app/models/bill_signature.rb index 7c61d66e4..e5778a912 100644 --- a/app/models/bill_signature.rb +++ b/app/models/bill_signature.rb @@ -1,12 +1,3 @@ -# == Schema Information -# -# Table name: bill_signatures -# -# id :bigint not null, primary key -# digest :string -# created_at :datetime not null -# updated_at :datetime not null -# class BillSignature < ApplicationRecord has_many :dossier_operation_logs diff --git a/app/models/bulk_message.rb b/app/models/bulk_message.rb index f495e3510..6de6905a3 100644 --- a/app/models/bulk_message.rb +++ b/app/models/bulk_message.rb @@ -1,16 +1,3 @@ -# == Schema Information -# -# Table name: bulk_messages -# -# id :bigint not null, primary key -# body :text not null -# dossier_count :integer -# dossier_state :string -# sent_at :datetime not null -# created_at :datetime not null -# updated_at :datetime not null -# instructeur_id :bigint not null -# class BulkMessage < ApplicationRecord belongs_to :instructeur has_and_belongs_to_many :groupe_instructeurs, -> { order(:label) } diff --git a/app/models/champ.rb b/app/models/champ.rb index 81b0f2864..66a273319 100644 --- a/app/models/champ.rb +++ b/app/models/champ.rb @@ -1,25 +1,3 @@ -# == Schema Information -# -# Table name: champs -# -# id :integer not null, primary key -# data :jsonb -# fetch_external_data_exceptions :string is an Array -# prefilled :boolean -# private :boolean default(FALSE), not null -# rebased_at :datetime -# type :string -# value :string -# value_json :jsonb -# created_at :datetime -# updated_at :datetime -# dossier_id :integer -# etablissement_id :integer -# external_id :string -# parent_id :bigint -# row_id :string -# type_de_champ_id :integer -# class Champ < ApplicationRecord include ChampConditionalConcern diff --git a/app/models/champs/address_champ.rb b/app/models/champs/address_champ.rb index a041d14fb..7f8c87ae6 100644 --- a/app/models/champs/address_champ.rb +++ b/app/models/champs/address_champ.rb @@ -1,25 +1,3 @@ -# == Schema Information -# -# Table name: champs -# -# id :integer not null, primary key -# data :jsonb -# fetch_external_data_exceptions :string is an Array -# prefilled :boolean default(FALSE) -# private :boolean default(FALSE), not null -# rebased_at :datetime -# type :string -# value :string -# value_json :jsonb -# created_at :datetime -# updated_at :datetime -# dossier_id :integer -# etablissement_id :integer -# external_id :string -# parent_id :bigint -# row_id :string -# type_de_champ_id :integer -# class Champs::AddressChamp < Champs::TextChamp def full_address? data.present? diff --git a/app/models/champs/annuaire_education_champ.rb b/app/models/champs/annuaire_education_champ.rb index 46a3ee389..e691b707b 100644 --- a/app/models/champs/annuaire_education_champ.rb +++ b/app/models/champs/annuaire_education_champ.rb @@ -1,25 +1,3 @@ -# == Schema Information -# -# Table name: champs -# -# id :integer not null, primary key -# data :jsonb -# fetch_external_data_exceptions :string is an Array -# prefilled :boolean default(FALSE) -# private :boolean default(FALSE), not null -# rebased_at :datetime -# type :string -# value :string -# value_json :jsonb -# created_at :datetime -# updated_at :datetime -# dossier_id :integer -# etablissement_id :integer -# external_id :string -# parent_id :bigint -# row_id :string -# type_de_champ_id :integer -# class Champs::AnnuaireEducationChamp < Champs::TextChamp def fetch_external_data? true diff --git a/app/models/champs/boolean_champ.rb b/app/models/champs/boolean_champ.rb index 5539369dc..f474944d7 100644 --- a/app/models/champs/boolean_champ.rb +++ b/app/models/champs/boolean_champ.rb @@ -1,25 +1,3 @@ -# == Schema Information -# -# Table name: champs -# -# id :integer not null, primary key -# data :jsonb -# fetch_external_data_exceptions :string is an Array -# prefilled :boolean default(FALSE) -# private :boolean default(FALSE), not null -# rebased_at :datetime -# type :string -# value :string -# value_json :jsonb -# created_at :datetime -# updated_at :datetime -# dossier_id :integer -# etablissement_id :integer -# external_id :string -# parent_id :bigint -# row_id :string -# type_de_champ_id :integer -# class Champs::BooleanChamp < Champ TRUE_VALUE = 'true' FALSE_VALUE = 'false' diff --git a/app/models/champs/carte_champ.rb b/app/models/champs/carte_champ.rb index 208b72dfb..c3114388e 100644 --- a/app/models/champs/carte_champ.rb +++ b/app/models/champs/carte_champ.rb @@ -1,25 +1,3 @@ -# == Schema Information -# -# Table name: champs -# -# id :integer not null, primary key -# data :jsonb -# fetch_external_data_exceptions :string is an Array -# prefilled :boolean default(FALSE) -# private :boolean default(FALSE), not null -# rebased_at :datetime -# type :string -# value :string -# value_json :jsonb -# created_at :datetime -# updated_at :datetime -# dossier_id :integer -# etablissement_id :integer -# external_id :string -# parent_id :bigint -# row_id :string -# type_de_champ_id :integer -# class Champs::CarteChamp < Champ # Default map location. Center of the World, ahm, France... DEFAULT_LON = 2.428462 diff --git a/app/models/champs/checkbox_champ.rb b/app/models/champs/checkbox_champ.rb index f8d5b72f5..dd67f7be0 100644 --- a/app/models/champs/checkbox_champ.rb +++ b/app/models/champs/checkbox_champ.rb @@ -1,25 +1,3 @@ -# == Schema Information -# -# Table name: champs -# -# id :integer not null, primary key -# data :jsonb -# fetch_external_data_exceptions :string is an Array -# prefilled :boolean default(FALSE) -# private :boolean default(FALSE), not null -# rebased_at :datetime -# type :string -# value :string -# value_json :jsonb -# created_at :datetime -# updated_at :datetime -# dossier_id :integer -# etablissement_id :integer -# external_id :string -# parent_id :bigint -# row_id :string -# type_de_champ_id :integer -# class Champs::CheckboxChamp < Champs::BooleanChamp def for_export true? ? 'on' : 'off' diff --git a/app/models/champs/civilite_champ.rb b/app/models/champs/civilite_champ.rb index 1d25877a6..2f19c8009 100644 --- a/app/models/champs/civilite_champ.rb +++ b/app/models/champs/civilite_champ.rb @@ -1,25 +1,3 @@ -# == Schema Information -# -# Table name: champs -# -# id :integer not null, primary key -# data :jsonb -# fetch_external_data_exceptions :string is an Array -# prefilled :boolean default(FALSE) -# private :boolean default(FALSE), not null -# rebased_at :datetime -# type :string -# value :string -# value_json :jsonb -# created_at :datetime -# updated_at :datetime -# dossier_id :integer -# etablissement_id :integer -# external_id :string -# parent_id :bigint -# row_id :string -# type_de_champ_id :integer -# class Champs::CiviliteChamp < Champ validates :value, inclusion: ["M.", "Mme"], allow_nil: true, allow_blank: false diff --git a/app/models/champs/cnaf_champ.rb b/app/models/champs/cnaf_champ.rb index c3ac55170..2ddb6586f 100644 --- a/app/models/champs/cnaf_champ.rb +++ b/app/models/champs/cnaf_champ.rb @@ -1,25 +1,3 @@ -# == Schema Information -# -# Table name: champs -# -# id :integer not null, primary key -# data :jsonb -# fetch_external_data_exceptions :string is an Array -# prefilled :boolean default(FALSE) -# private :boolean default(FALSE), not null -# rebased_at :datetime -# type :string -# value :string -# value_json :jsonb -# created_at :datetime -# updated_at :datetime -# dossier_id :integer -# etablissement_id :integer -# external_id :string -# parent_id :bigint -# row_id :string -# type_de_champ_id :integer -# class Champs::CnafChamp < Champs::TextChamp # see https://github.com/betagouv/api-particulier/blob/master/src/presentation/middlewares/cnaf-input-validation.middleware.ts validates :numero_allocataire, format: { with: /\A\d{1,7}\z/ }, if: -> { code_postal.present? && validation_context != :brouillon } diff --git a/app/models/champs/commune_champ.rb b/app/models/champs/commune_champ.rb index 9dafdc4d5..9b9ca0335 100644 --- a/app/models/champs/commune_champ.rb +++ b/app/models/champs/commune_champ.rb @@ -1,25 +1,3 @@ -# == Schema Information -# -# Table name: champs -# -# id :integer not null, primary key -# data :jsonb -# fetch_external_data_exceptions :string is an Array -# prefilled :boolean default(FALSE) -# private :boolean default(FALSE), not null -# rebased_at :datetime -# type :string -# value :string -# value_json :jsonb -# created_at :datetime -# updated_at :datetime -# dossier_id :integer -# etablissement_id :integer -# external_id :string -# parent_id :bigint -# row_id :string -# type_de_champ_id :integer -# class Champs::CommuneChamp < Champs::TextChamp store_accessor :value_json, :code_departement, :code_postal before_validation :on_code_postal_change diff --git a/app/models/champs/date_champ.rb b/app/models/champs/date_champ.rb index f6fcea185..10fa8602c 100644 --- a/app/models/champs/date_champ.rb +++ b/app/models/champs/date_champ.rb @@ -1,25 +1,3 @@ -# == Schema Information -# -# Table name: champs -# -# id :integer not null, primary key -# data :jsonb -# fetch_external_data_exceptions :string is an Array -# prefilled :boolean default(FALSE) -# private :boolean default(FALSE), not null -# rebased_at :datetime -# type :string -# value :string -# value_json :jsonb -# created_at :datetime -# updated_at :datetime -# dossier_id :integer -# etablissement_id :integer -# external_id :string -# parent_id :bigint -# row_id :string -# type_de_champ_id :integer -# class Champs::DateChamp < Champ before_validation :convert_to_iso8601, unless: -> { validation_context == :prefill } validate :iso_8601 diff --git a/app/models/champs/datetime_champ.rb b/app/models/champs/datetime_champ.rb index 6e8ed59cc..fb4806aab 100644 --- a/app/models/champs/datetime_champ.rb +++ b/app/models/champs/datetime_champ.rb @@ -1,25 +1,3 @@ -# == Schema Information -# -# Table name: champs -# -# id :integer not null, primary key -# data :jsonb -# fetch_external_data_exceptions :string is an Array -# prefilled :boolean default(FALSE) -# private :boolean default(FALSE), not null -# rebased_at :datetime -# type :string -# value :string -# value_json :jsonb -# created_at :datetime -# updated_at :datetime -# dossier_id :integer -# etablissement_id :integer -# external_id :string -# parent_id :bigint -# row_id :string -# type_de_champ_id :integer -# class Champs::DatetimeChamp < Champ before_validation :convert_to_iso8601, unless: -> { validation_context == :prefill } validate :iso_8601 diff --git a/app/models/champs/decimal_number_champ.rb b/app/models/champs/decimal_number_champ.rb index e6f66be76..31278e52a 100644 --- a/app/models/champs/decimal_number_champ.rb +++ b/app/models/champs/decimal_number_champ.rb @@ -1,25 +1,3 @@ -# == Schema Information -# -# Table name: champs -# -# id :integer not null, primary key -# data :jsonb -# fetch_external_data_exceptions :string is an Array -# prefilled :boolean default(FALSE) -# private :boolean default(FALSE), not null -# rebased_at :datetime -# type :string -# value :string -# value_json :jsonb -# created_at :datetime -# updated_at :datetime -# dossier_id :integer -# etablissement_id :integer -# external_id :string -# parent_id :bigint -# row_id :string -# type_de_champ_id :integer -# class Champs::DecimalNumberChamp < Champ validates :value, numericality: { allow_nil: true, diff --git a/app/models/champs/departement_champ.rb b/app/models/champs/departement_champ.rb index 5a99ce8ad..1447ec193 100644 --- a/app/models/champs/departement_champ.rb +++ b/app/models/champs/departement_champ.rb @@ -1,25 +1,3 @@ -# == Schema Information -# -# Table name: champs -# -# id :integer not null, primary key -# data :jsonb -# fetch_external_data_exceptions :string is an Array -# prefilled :boolean default(FALSE) -# private :boolean default(FALSE), not null -# rebased_at :datetime -# type :string -# value :string -# value_json :jsonb -# created_at :datetime -# updated_at :datetime -# dossier_id :integer -# etablissement_id :integer -# external_id :string -# parent_id :bigint -# row_id :string -# type_de_champ_id :integer -# class Champs::DepartementChamp < Champs::TextChamp validate :value_in_departement_names, unless: -> { value.nil? } validate :external_id_in_departement_codes, unless: -> { external_id.nil? } diff --git a/app/models/champs/dgfip_champ.rb b/app/models/champs/dgfip_champ.rb index 5c84c1b43..832897518 100644 --- a/app/models/champs/dgfip_champ.rb +++ b/app/models/champs/dgfip_champ.rb @@ -1,25 +1,3 @@ -# == Schema Information -# -# Table name: champs -# -# id :integer not null, primary key -# data :jsonb -# fetch_external_data_exceptions :string is an Array -# prefilled :boolean default(FALSE) -# private :boolean default(FALSE), not null -# rebased_at :datetime -# type :string -# value :string -# value_json :jsonb -# created_at :datetime -# updated_at :datetime -# dossier_id :integer -# etablissement_id :integer -# external_id :string -# parent_id :bigint -# row_id :string -# type_de_champ_id :integer -# class Champs::DgfipChamp < Champs::TextChamp # see https://github.com/betagouv/api-particulier/blob/master/src/presentation/middlewares/dgfip-input-validation.middleware.ts validates :numero_fiscal, format: { with: /\A\w{13,14}\z/ }, if: -> { reference_avis.present? && validation_context != :brouillon } diff --git a/app/models/champs/dossier_link_champ.rb b/app/models/champs/dossier_link_champ.rb index 00c7f8869..ba73ddce6 100644 --- a/app/models/champs/dossier_link_champ.rb +++ b/app/models/champs/dossier_link_champ.rb @@ -1,25 +1,3 @@ -# == Schema Information -# -# Table name: champs -# -# id :integer not null, primary key -# data :jsonb -# fetch_external_data_exceptions :string is an Array -# prefilled :boolean default(FALSE) -# private :boolean default(FALSE), not null -# rebased_at :datetime -# type :string -# value :string -# value_json :jsonb -# created_at :datetime -# updated_at :datetime -# dossier_id :integer -# etablissement_id :integer -# external_id :string -# parent_id :bigint -# row_id :string -# type_de_champ_id :integer -# class Champs::DossierLinkChamp < Champ validate :value_integerable, if: -> { value.present? }, on: :prefill diff --git a/app/models/champs/drop_down_list_champ.rb b/app/models/champs/drop_down_list_champ.rb index 467643673..5e1e86722 100644 --- a/app/models/champs/drop_down_list_champ.rb +++ b/app/models/champs/drop_down_list_champ.rb @@ -1,25 +1,3 @@ -# == Schema Information -# -# Table name: champs -# -# id :integer not null, primary key -# data :jsonb -# fetch_external_data_exceptions :string is an Array -# prefilled :boolean default(FALSE) -# private :boolean default(FALSE), not null -# rebased_at :datetime -# type :string -# value :string -# value_json :jsonb -# created_at :datetime -# updated_at :datetime -# dossier_id :integer -# etablissement_id :integer -# external_id :string -# parent_id :bigint -# row_id :string -# type_de_champ_id :integer -# class Champs::DropDownListChamp < Champ store_accessor :value_json, :other THRESHOLD_NB_OPTIONS_AS_RADIO = 5 diff --git a/app/models/champs/email_champ.rb b/app/models/champs/email_champ.rb index 0c17ea122..5f5f36104 100644 --- a/app/models/champs/email_champ.rb +++ b/app/models/champs/email_champ.rb @@ -1,24 +1,2 @@ -# == Schema Information -# -# Table name: champs -# -# id :integer not null, primary key -# data :jsonb -# fetch_external_data_exceptions :string is an Array -# prefilled :boolean default(FALSE) -# private :boolean default(FALSE), not null -# rebased_at :datetime -# type :string -# value :string -# value_json :jsonb -# created_at :datetime -# updated_at :datetime -# dossier_id :integer -# etablissement_id :integer -# external_id :string -# parent_id :bigint -# row_id :string -# type_de_champ_id :integer -# class Champs::EmailChamp < Champs::TextChamp end diff --git a/app/models/champs/epci_champ.rb b/app/models/champs/epci_champ.rb index 0607cf67e..3b65f864f 100644 --- a/app/models/champs/epci_champ.rb +++ b/app/models/champs/epci_champ.rb @@ -1,25 +1,3 @@ -# == Schema Information -# -# Table name: champs -# -# id :integer not null, primary key -# data :jsonb -# fetch_external_data_exceptions :string is an Array -# prefilled :boolean default(FALSE) -# private :boolean default(FALSE), not null -# rebased_at :datetime -# type :string -# value :string -# value_json :jsonb -# created_at :datetime -# updated_at :datetime -# dossier_id :integer -# etablissement_id :integer -# external_id :string -# parent_id :bigint -# row_id :string -# type_de_champ_id :integer -# class Champs::EpciChamp < Champs::TextChamp store_accessor :value_json, :code_departement before_validation :on_departement_change diff --git a/app/models/champs/explication_champ.rb b/app/models/champs/explication_champ.rb index c81759dd2..d15bd2e1d 100644 --- a/app/models/champs/explication_champ.rb +++ b/app/models/champs/explication_champ.rb @@ -1,25 +1,3 @@ -# == Schema Information -# -# Table name: champs -# -# id :integer not null, primary key -# data :jsonb -# fetch_external_data_exceptions :string is an Array -# prefilled :boolean default(FALSE) -# private :boolean default(FALSE), not null -# rebased_at :datetime -# type :string -# value :string -# value_json :jsonb -# created_at :datetime -# updated_at :datetime -# dossier_id :integer -# etablissement_id :integer -# external_id :string -# parent_id :bigint -# row_id :string -# type_de_champ_id :integer -# class Champs::ExplicationChamp < Champs::TextChamp def search_terms # The user cannot enter any information here so it doesn’t make much sense to search diff --git a/app/models/champs/header_section_champ.rb b/app/models/champs/header_section_champ.rb index 03efd51d8..69ac6d54c 100644 --- a/app/models/champs/header_section_champ.rb +++ b/app/models/champs/header_section_champ.rb @@ -1,25 +1,3 @@ -# == Schema Information -# -# Table name: champs -# -# id :integer not null, primary key -# data :jsonb -# fetch_external_data_exceptions :string is an Array -# prefilled :boolean default(FALSE) -# private :boolean default(FALSE), not null -# rebased_at :datetime -# type :string -# value :string -# value_json :jsonb -# created_at :datetime -# updated_at :datetime -# dossier_id :integer -# etablissement_id :integer -# external_id :string -# parent_id :bigint -# row_id :string -# type_de_champ_id :integer -# class Champs::HeaderSectionChamp < Champ def level if parent.present? diff --git a/app/models/champs/iban_champ.rb b/app/models/champs/iban_champ.rb index 9e40cd3f2..577dbc09c 100644 --- a/app/models/champs/iban_champ.rb +++ b/app/models/champs/iban_champ.rb @@ -1,25 +1,3 @@ -# == Schema Information -# -# Table name: champs -# -# id :integer not null, primary key -# data :jsonb -# fetch_external_data_exceptions :string is an Array -# prefilled :boolean default(FALSE) -# private :boolean default(FALSE), not null -# rebased_at :datetime -# type :string -# value :string -# value_json :jsonb -# created_at :datetime -# updated_at :datetime -# dossier_id :integer -# etablissement_id :integer -# external_id :string -# parent_id :bigint -# row_id :string -# type_de_champ_id :integer -# class Champs::IbanChamp < Champ validates_with IbanValidator, if: -> { validation_context != :brouillon } after_validation :format_iban diff --git a/app/models/champs/integer_number_champ.rb b/app/models/champs/integer_number_champ.rb index 29ca29e05..b78af269c 100644 --- a/app/models/champs/integer_number_champ.rb +++ b/app/models/champs/integer_number_champ.rb @@ -1,25 +1,3 @@ -# == Schema Information -# -# Table name: champs -# -# id :integer not null, primary key -# data :jsonb -# fetch_external_data_exceptions :string is an Array -# prefilled :boolean default(FALSE) -# private :boolean default(FALSE), not null -# rebased_at :datetime -# type :string -# value :string -# value_json :jsonb -# created_at :datetime -# updated_at :datetime -# dossier_id :integer -# etablissement_id :integer -# external_id :string -# parent_id :bigint -# row_id :string -# type_de_champ_id :integer -# class Champs::IntegerNumberChamp < Champ validates :value, numericality: { only_integer: true, diff --git a/app/models/champs/linked_drop_down_list_champ.rb b/app/models/champs/linked_drop_down_list_champ.rb index 31a44c32c..0033a0a70 100644 --- a/app/models/champs/linked_drop_down_list_champ.rb +++ b/app/models/champs/linked_drop_down_list_champ.rb @@ -1,25 +1,3 @@ -# == Schema Information -# -# Table name: champs -# -# id :integer not null, primary key -# data :jsonb -# fetch_external_data_exceptions :string is an Array -# prefilled :boolean default(FALSE) -# private :boolean default(FALSE), not null -# rebased_at :datetime -# type :string -# value :string -# value_json :jsonb -# created_at :datetime -# updated_at :datetime -# dossier_id :integer -# etablissement_id :integer -# external_id :string -# parent_id :bigint -# row_id :string -# type_de_champ_id :integer -# class Champs::LinkedDropDownListChamp < Champ delegate :primary_options, :secondary_options, to: 'type_de_champ.dynamic_type' diff --git a/app/models/champs/mesri_champ.rb b/app/models/champs/mesri_champ.rb index 82df2db85..d12bc3c59 100644 --- a/app/models/champs/mesri_champ.rb +++ b/app/models/champs/mesri_champ.rb @@ -1,25 +1,3 @@ -# == Schema Information -# -# Table name: champs -# -# id :integer not null, primary key -# data :jsonb -# fetch_external_data_exceptions :string is an Array -# prefilled :boolean default(FALSE) -# private :boolean default(FALSE), not null -# rebased_at :datetime -# type :string -# value :string -# value_json :jsonb -# created_at :datetime -# updated_at :datetime -# dossier_id :integer -# etablissement_id :integer -# external_id :string -# parent_id :bigint -# row_id :string -# type_de_champ_id :integer -# class Champs::MesriChamp < Champs::TextChamp # see https://github.com/betagouv/api-particulier/blob/master/src/presentation/middlewares/mesri-input-validation.middleware.ts store_accessor :value_json, :ine diff --git a/app/models/champs/multiple_drop_down_list_champ.rb b/app/models/champs/multiple_drop_down_list_champ.rb index 7b4d2d99a..9484ebe5e 100644 --- a/app/models/champs/multiple_drop_down_list_champ.rb +++ b/app/models/champs/multiple_drop_down_list_champ.rb @@ -1,25 +1,3 @@ -# == Schema Information -# -# Table name: champs -# -# id :integer not null, primary key -# data :jsonb -# fetch_external_data_exceptions :string is an Array -# prefilled :boolean default(FALSE) -# private :boolean default(FALSE), not null -# rebased_at :datetime -# type :string -# value :string -# value_json :jsonb -# created_at :datetime -# updated_at :datetime -# dossier_id :integer -# etablissement_id :integer -# external_id :string -# parent_id :bigint -# row_id :string -# type_de_champ_id :integer -# class Champs::MultipleDropDownListChamp < Champ validate :values_are_in_options, if: -> { value.present? } diff --git a/app/models/champs/number_champ.rb b/app/models/champs/number_champ.rb index 320aa22e7..8903284e2 100644 --- a/app/models/champs/number_champ.rb +++ b/app/models/champs/number_champ.rb @@ -1,24 +1,2 @@ -# == Schema Information -# -# Table name: champs -# -# id :integer not null, primary key -# data :jsonb -# fetch_external_data_exceptions :string is an Array -# prefilled :boolean default(FALSE) -# private :boolean default(FALSE), not null -# rebased_at :datetime -# type :string -# value :string -# value_json :jsonb -# created_at :datetime -# updated_at :datetime -# dossier_id :integer -# etablissement_id :integer -# external_id :string -# parent_id :bigint -# row_id :string -# type_de_champ_id :integer -# class Champs::NumberChamp < Champ end diff --git a/app/models/champs/pays_champ.rb b/app/models/champs/pays_champ.rb index b00402850..5029deea6 100644 --- a/app/models/champs/pays_champ.rb +++ b/app/models/champs/pays_champ.rb @@ -1,25 +1,3 @@ -# == Schema Information -# -# Table name: champs -# -# id :integer not null, primary key -# data :jsonb -# fetch_external_data_exceptions :string is an Array -# prefilled :boolean default(FALSE) -# private :boolean default(FALSE), not null -# rebased_at :datetime -# type :string -# value :string -# value_json :jsonb -# created_at :datetime -# updated_at :datetime -# dossier_id :integer -# etablissement_id :integer -# external_id :string -# parent_id :bigint -# row_id :string -# type_de_champ_id :integer -# class Champs::PaysChamp < Champs::TextChamp validates :value, inclusion: APIGeoService.countries.pluck(:name), allow_nil: true, allow_blank: false validates :external_id, inclusion: APIGeoService.countries.pluck(:code), allow_nil: true, allow_blank: false diff --git a/app/models/champs/phone_champ.rb b/app/models/champs/phone_champ.rb index 3e0c978f4..1d44152ad 100644 --- a/app/models/champs/phone_champ.rb +++ b/app/models/champs/phone_champ.rb @@ -1,25 +1,3 @@ -# == Schema Information -# -# Table name: champs -# -# id :integer not null, primary key -# data :jsonb -# fetch_external_data_exceptions :string is an Array -# prefilled :boolean default(FALSE) -# private :boolean default(FALSE), not null -# rebased_at :datetime -# type :string -# value :string -# value_json :jsonb -# created_at :datetime -# updated_at :datetime -# dossier_id :integer -# etablissement_id :integer -# external_id :string -# parent_id :bigint -# row_id :string -# type_de_champ_id :integer -# class Champs::PhoneChamp < Champs::TextChamp # We want to allow: # * international (e164) phone numbers diff --git a/app/models/champs/piece_justificative_champ.rb b/app/models/champs/piece_justificative_champ.rb index e95af2bf5..0ccbb83d7 100644 --- a/app/models/champs/piece_justificative_champ.rb +++ b/app/models/champs/piece_justificative_champ.rb @@ -1,25 +1,3 @@ -# == Schema Information -# -# Table name: champs -# -# id :integer not null, primary key -# data :jsonb -# fetch_external_data_exceptions :string is an Array -# prefilled :boolean default(FALSE) -# private :boolean default(FALSE), not null -# rebased_at :datetime -# type :string -# value :string -# value_json :jsonb -# created_at :datetime -# updated_at :datetime -# dossier_id :integer -# etablissement_id :integer -# external_id :string -# parent_id :bigint -# row_id :string -# type_de_champ_id :integer -# class Champs::PieceJustificativeChamp < Champ FILE_MAX_SIZE = 200.megabytes diff --git a/app/models/champs/pole_emploi_champ.rb b/app/models/champs/pole_emploi_champ.rb index 1d9951d1c..e7cfde785 100644 --- a/app/models/champs/pole_emploi_champ.rb +++ b/app/models/champs/pole_emploi_champ.rb @@ -1,25 +1,3 @@ -# == Schema Information -# -# Table name: champs -# -# id :integer not null, primary key -# data :jsonb -# fetch_external_data_exceptions :string is an Array -# prefilled :boolean default(FALSE) -# private :boolean default(FALSE), not null -# rebased_at :datetime -# type :string -# value :string -# value_json :jsonb -# created_at :datetime -# updated_at :datetime -# dossier_id :integer -# etablissement_id :integer -# external_id :string -# parent_id :bigint -# row_id :string -# type_de_champ_id :integer -# class Champs::PoleEmploiChamp < Champs::TextChamp # see https://github.com/betagouv/api-particulier/blob/master/src/presentation/middlewares/pole-emploi-input-validation.middleware.ts store_accessor :value_json, :identifiant diff --git a/app/models/champs/region_champ.rb b/app/models/champs/region_champ.rb index a842b577a..5e2c60b05 100644 --- a/app/models/champs/region_champ.rb +++ b/app/models/champs/region_champ.rb @@ -1,25 +1,3 @@ -# == Schema Information -# -# Table name: champs -# -# id :integer not null, primary key -# data :jsonb -# fetch_external_data_exceptions :string is an Array -# prefilled :boolean default(FALSE) -# private :boolean default(FALSE), not null -# rebased_at :datetime -# type :string -# value :string -# value_json :jsonb -# created_at :datetime -# updated_at :datetime -# dossier_id :integer -# etablissement_id :integer -# external_id :string -# parent_id :bigint -# row_id :string -# type_de_champ_id :integer -# class Champs::RegionChamp < Champs::TextChamp validate :value_in_region_names, unless: -> { value.nil? } validate :external_id_in_region_codes, unless: -> { external_id.nil? } diff --git a/app/models/champs/repetition_champ.rb b/app/models/champs/repetition_champ.rb index d2dc460bc..ed9d91c00 100644 --- a/app/models/champs/repetition_champ.rb +++ b/app/models/champs/repetition_champ.rb @@ -1,25 +1,3 @@ -# == Schema Information -# -# Table name: champs -# -# id :integer not null, primary key -# data :jsonb -# fetch_external_data_exceptions :string is an Array -# prefilled :boolean default(FALSE) -# private :boolean default(FALSE), not null -# rebased_at :datetime -# type :string -# value :string -# value_json :jsonb -# created_at :datetime -# updated_at :datetime -# dossier_id :integer -# etablissement_id :integer -# external_id :string -# parent_id :bigint -# row_id :string -# type_de_champ_id :integer -# class Champs::RepetitionChamp < Champ accepts_nested_attributes_for :champs delegate :libelle_for_export, to: :type_de_champ diff --git a/app/models/champs/rna_champ.rb b/app/models/champs/rna_champ.rb index 5bf7c78f0..3e521dd88 100644 --- a/app/models/champs/rna_champ.rb +++ b/app/models/champs/rna_champ.rb @@ -1,25 +1,3 @@ -# == Schema Information -# -# Table name: champs -# -# id :integer not null, primary key -# data :jsonb -# fetch_external_data_exceptions :string is an Array -# prefilled :boolean default(FALSE) -# private :boolean default(FALSE), not null -# rebased_at :datetime -# type :string -# value :string -# value_json :jsonb -# created_at :datetime -# updated_at :datetime -# dossier_id :integer -# etablissement_id :integer -# external_id :string -# parent_id :bigint -# row_id :string -# type_de_champ_id :integer -# class Champs::RNAChamp < Champ include RNAChampAssociationFetchableConcern diff --git a/app/models/champs/siret_champ.rb b/app/models/champs/siret_champ.rb index 0901c3227..54c350544 100644 --- a/app/models/champs/siret_champ.rb +++ b/app/models/champs/siret_champ.rb @@ -1,25 +1,3 @@ -# == Schema Information -# -# Table name: champs -# -# id :integer not null, primary key -# data :jsonb -# fetch_external_data_exceptions :string is an Array -# prefilled :boolean default(FALSE) -# private :boolean default(FALSE), not null -# rebased_at :datetime -# type :string -# value :string -# value_json :jsonb -# created_at :datetime -# updated_at :datetime -# dossier_id :integer -# etablissement_id :integer -# external_id :string -# parent_id :bigint -# row_id :string -# type_de_champ_id :integer -# class Champs::SiretChamp < Champ include SiretChampEtablissementFetchableConcern diff --git a/app/models/champs/text_champ.rb b/app/models/champs/text_champ.rb index 6a49e6a3e..8e24252ce 100644 --- a/app/models/champs/text_champ.rb +++ b/app/models/champs/text_champ.rb @@ -1,24 +1,2 @@ -# == Schema Information -# -# Table name: champs -# -# id :integer not null, primary key -# data :jsonb -# fetch_external_data_exceptions :string is an Array -# prefilled :boolean default(FALSE) -# private :boolean default(FALSE), not null -# rebased_at :datetime -# type :string -# value :string -# value_json :jsonb -# created_at :datetime -# updated_at :datetime -# dossier_id :integer -# etablissement_id :integer -# external_id :string -# parent_id :bigint -# row_id :string -# type_de_champ_id :integer -# class Champs::TextChamp < Champ end diff --git a/app/models/champs/textarea_champ.rb b/app/models/champs/textarea_champ.rb index 24a744c59..289289c57 100644 --- a/app/models/champs/textarea_champ.rb +++ b/app/models/champs/textarea_champ.rb @@ -1,25 +1,3 @@ -# == Schema Information -# -# Table name: champs -# -# id :integer not null, primary key -# data :jsonb -# fetch_external_data_exceptions :string is an Array -# prefilled :boolean default(FALSE) -# private :boolean default(FALSE), not null -# rebased_at :datetime -# type :string -# value :string -# value_json :jsonb -# created_at :datetime -# updated_at :datetime -# dossier_id :integer -# etablissement_id :integer -# external_id :string -# parent_id :bigint -# row_id :string -# type_de_champ_id :integer -# class Champs::TextareaChamp < Champs::TextChamp def for_export value.present? ? ActionView::Base.full_sanitizer.sanitize(value) : nil diff --git a/app/models/champs/titre_identite_champ.rb b/app/models/champs/titre_identite_champ.rb index c9c925d97..a24d7bef2 100644 --- a/app/models/champs/titre_identite_champ.rb +++ b/app/models/champs/titre_identite_champ.rb @@ -1,25 +1,3 @@ -# == Schema Information -# -# Table name: champs -# -# id :integer not null, primary key -# data :jsonb -# fetch_external_data_exceptions :string is an Array -# prefilled :boolean default(FALSE) -# private :boolean default(FALSE), not null -# rebased_at :datetime -# type :string -# value :string -# value_json :jsonb -# created_at :datetime -# updated_at :datetime -# dossier_id :integer -# etablissement_id :integer -# external_id :string -# parent_id :bigint -# row_id :string -# type_de_champ_id :integer -# class Champs::TitreIdentiteChamp < Champ FILE_MAX_SIZE = 20.megabytes ACCEPTED_FORMATS = ['image/png', 'image/jpeg'] diff --git a/app/models/champs/yes_no_champ.rb b/app/models/champs/yes_no_champ.rb index 1d47a671e..3b814e295 100644 --- a/app/models/champs/yes_no_champ.rb +++ b/app/models/champs/yes_no_champ.rb @@ -1,25 +1,3 @@ -# == Schema Information -# -# Table name: champs -# -# id :integer not null, primary key -# data :jsonb -# fetch_external_data_exceptions :string is an Array -# prefilled :boolean default(FALSE) -# private :boolean default(FALSE), not null -# rebased_at :datetime -# type :string -# value :string -# value_json :jsonb -# created_at :datetime -# updated_at :datetime -# dossier_id :integer -# etablissement_id :integer -# external_id :string -# parent_id :bigint -# row_id :string -# type_de_champ_id :integer -# class Champs::YesNoChamp < Champs::BooleanChamp def yes_input_id "#{input_id}-yes" diff --git a/app/models/commentaire.rb b/app/models/commentaire.rb index 99e086747..4cac74bf1 100644 --- a/app/models/commentaire.rb +++ b/app/models/commentaire.rb @@ -1,17 +1,3 @@ -# == Schema Information -# -# Table name: commentaires -# -# id :integer not null, primary key -# body :string -# discarded_at :datetime -# email :string -# created_at :datetime not null -# updated_at :datetime not null -# dossier_id :integer -# expert_id :bigint -# instructeur_id :bigint -# class Commentaire < ApplicationRecord include Discard::Model diff --git a/app/models/deleted_dossier.rb b/app/models/deleted_dossier.rb index edb9632ac..b415a7709 100644 --- a/app/models/deleted_dossier.rb +++ b/app/models/deleted_dossier.rb @@ -1,19 +1,3 @@ -# == Schema Information -# -# Table name: deleted_dossiers -# -# id :bigint not null, primary key -# deleted_at :datetime -# reason :string -# state :string -# created_at :datetime not null -# updated_at :datetime not null -# dossier_id :bigint -# groupe_instructeur_id :bigint -# procedure_id :bigint -# revision_id :bigint -# user_id :bigint -# class DeletedDossier < ApplicationRecord belongs_to :procedure, -> { with_discarded }, inverse_of: :deleted_dossiers, optional: false belongs_to :groupe_instructeur, inverse_of: :deleted_dossiers, optional: true diff --git a/app/models/dossier.rb b/app/models/dossier.rb index 230250e28..693e4fea9 100644 --- a/app/models/dossier.rb +++ b/app/models/dossier.rb @@ -1,54 +1,3 @@ -# == Schema Information -# -# Table name: dossiers -# -# id :integer not null, primary key -# api_entreprise_job_exceptions :string is an Array -# archived :boolean default(FALSE) -# archived_at :datetime -# archived_by :string -# autorisation_donnees :boolean -# brouillon_close_to_expiration_notice_sent_at :datetime -# conservation_extension :interval default(0 seconds) -# declarative_triggered_at :datetime -# deleted_user_email_never_send :string -# depose_at :datetime -# en_construction_at :datetime -# en_construction_close_to_expiration_notice_sent_at :datetime -# en_instruction_at :datetime -# for_procedure_preview :boolean default(FALSE) -# forced_groupe_instructeur :boolean -# groupe_instructeur_updated_at :datetime -# hidden_at :datetime -# hidden_by_administration_at :datetime -# hidden_by_reason :string -# hidden_by_user_at :datetime -# identity_updated_at :datetime -# last_avis_updated_at :datetime -# last_champ_private_updated_at :datetime -# last_champ_updated_at :datetime -# last_commentaire_updated_at :datetime -# migrated_champ_routage :boolean -# motivation :text -# prefill_token :string -# prefilled :boolean -# private_search_terms :string -# processed_at :datetime -# search_terms :string -# state :string -# sva_svr_decision_on :date -# sva_svr_decision_triggered_at :datetime -# termine_close_to_expiration_notice_sent_at :datetime -# created_at :datetime -# updated_at :datetime -# batch_operation_id :bigint -# dossier_transfer_id :bigint -# editing_fork_origin_id :bigint -# groupe_instructeur_id :bigint -# parent_dossier_id :bigint -# revision_id :bigint -# user_id :integer -# class Dossier < ApplicationRecord include DossierCloneConcern include DossierCorrectableConcern diff --git a/app/models/dossier_assignment.rb b/app/models/dossier_assignment.rb index 46917e188..90c517ad2 100644 --- a/app/models/dossier_assignment.rb +++ b/app/models/dossier_assignment.rb @@ -1,17 +1,3 @@ -# == Schema Information -# -# Table name: dossier_assignments -# -# id :bigint not null, primary key -# assigned_at :datetime not null -# assigned_by :string -# groupe_instructeur_label :string -# mode :string not null -# previous_groupe_instructeur_label :string -# dossier_id :bigint not null -# groupe_instructeur_id :bigint -# previous_groupe_instructeur_id :bigint -# class DossierAssignment < ApplicationRecord belongs_to :dossier diff --git a/app/models/dossier_batch_operation.rb b/app/models/dossier_batch_operation.rb index d126de57c..ca5582d22 100644 --- a/app/models/dossier_batch_operation.rb +++ b/app/models/dossier_batch_operation.rb @@ -1,14 +1,3 @@ -# == Schema Information -# -# Table name: dossier_batch_operations -# -# id :bigint not null, primary key -# state :string default("pending"), not null -# created_at :datetime not null -# updated_at :datetime not null -# batch_operation_id :bigint not null -# dossier_id :bigint not null -# class DossierBatchOperation < ApplicationRecord belongs_to :dossier belongs_to :batch_operation diff --git a/app/models/dossier_correction.rb b/app/models/dossier_correction.rb index 77dcdbf66..001da4f75 100644 --- a/app/models/dossier_correction.rb +++ b/app/models/dossier_correction.rb @@ -1,15 +1,3 @@ -# == Schema Information -# -# Table name: dossier_corrections -# -# id :bigint not null, primary key -# reason :string default("incorrect"), not null -# resolved_at :datetime -# created_at :datetime not null -# updated_at :datetime not null -# commentaire_id :bigint -# dossier_id :bigint not null -# class DossierCorrection < ApplicationRecord belongs_to :dossier belongs_to :commentaire diff --git a/app/models/dossier_operation_log.rb b/app/models/dossier_operation_log.rb index 3fa2072d6..902626a85 100644 --- a/app/models/dossier_operation_log.rb +++ b/app/models/dossier_operation_log.rb @@ -1,19 +1,3 @@ -# == Schema Information -# -# Table name: dossier_operation_logs -# -# id :bigint not null, primary key -# automatic_operation :boolean default(FALSE), not null -# data :jsonb -# digest :text -# executed_at :datetime -# keep_until :datetime -# operation :string not null -# created_at :datetime not null -# updated_at :datetime not null -# bill_signature_id :bigint -# dossier_id :bigint -# class DossierOperationLog < ApplicationRecord enum operation: { changer_groupe_instructeur: 'changer_groupe_instructeur', diff --git a/app/models/dossier_submitted_message.rb b/app/models/dossier_submitted_message.rb index 01238804c..c87e7c10b 100644 --- a/app/models/dossier_submitted_message.rb +++ b/app/models/dossier_submitted_message.rb @@ -1,12 +1,3 @@ -# == Schema Information -# -# Table name: dossier_submitted_messages -# -# id :bigint not null, primary key -# message_on_submit_by_usager :string -# created_at :datetime not null -# updated_at :datetime not null -# class DossierSubmittedMessage < ApplicationRecord has_many :revisions, class_name: 'ProcedureRevision', inverse_of: :dossier_submitted_message, dependent: :nullify end diff --git a/app/models/dossier_transfer.rb b/app/models/dossier_transfer.rb index 15c77d845..502801e21 100644 --- a/app/models/dossier_transfer.rb +++ b/app/models/dossier_transfer.rb @@ -1,12 +1,3 @@ -# == Schema Information -# -# Table name: dossier_transfers -# -# id :bigint not null, primary key -# email :string not null -# created_at :datetime not null -# updated_at :datetime not null -# class DossierTransfer < ApplicationRecord include EmailSanitizableConcern has_many :dossiers, dependent: :nullify diff --git a/app/models/dossier_transfer_log.rb b/app/models/dossier_transfer_log.rb index f551b608f..574a7bfb0 100644 --- a/app/models/dossier_transfer_log.rb +++ b/app/models/dossier_transfer_log.rb @@ -1,14 +1,3 @@ -# == Schema Information -# -# Table name: dossier_transfer_logs -# -# id :bigint not null, primary key -# from :string not null -# to :string not null -# created_at :datetime not null -# updated_at :datetime not null -# dossier_id :bigint not null -# class DossierTransferLog < ApplicationRecord belongs_to :dossier end diff --git a/app/models/email_event.rb b/app/models/email_event.rb index 89e6e64ee..26f066e62 100644 --- a/app/models/email_event.rb +++ b/app/models/email_event.rb @@ -1,17 +1,3 @@ -# == Schema Information -# -# Table name: email_events -# -# id :bigint not null, primary key -# method :string not null -# processed_at :datetime -# status :string not null -# subject :string not null -# to :string not null -# created_at :datetime not null -# updated_at :datetime not null -# message_id :string -# class EmailEvent < ApplicationRecord RETENTION_DURATION = 1.month diff --git a/app/models/etablissement.rb b/app/models/etablissement.rb index ef3b47d6c..8937ad62e 100644 --- a/app/models/etablissement.rb +++ b/app/models/etablissement.rb @@ -1,52 +1,3 @@ -# == Schema Information -# -# Table name: etablissements -# -# id :integer not null, primary key -# adresse :string -# association_date_creation :date -# association_date_declaration :date -# association_date_publication :date -# association_objet :text -# association_rna :string -# association_titre :string -# code_insee_localite :string -# code_postal :string -# complement_adresse :string -# diffusable_commercialement :boolean -# enseigne :string -# entreprise_bilans_bdf :jsonb -# entreprise_bilans_bdf_monnaie :string -# entreprise_capital_social :bigint -# entreprise_code_effectif_entreprise :string -# entreprise_date_creation :date -# entreprise_effectif_annee :string -# entreprise_effectif_annuel :decimal(, ) -# entreprise_effectif_annuel_annee :string -# entreprise_effectif_mensuel :decimal(, ) -# entreprise_effectif_mois :string -# entreprise_etat_administratif :string -# entreprise_forme_juridique :string -# entreprise_forme_juridique_code :string -# entreprise_nom :string -# entreprise_nom_commercial :string -# entreprise_numero_tva_intracommunautaire :string -# entreprise_prenom :string -# entreprise_raison_sociale :string -# entreprise_siren :string -# entreprise_siret_siege_social :string -# libelle_naf :string -# localite :string -# naf :string -# nom_voie :string -# numero_voie :string -# siege_social :boolean -# siret :string -# type_voie :string -# created_at :datetime -# updated_at :datetime -# dossier_id :integer -# class Etablissement < ApplicationRecord belongs_to :dossier, optional: true diff --git a/app/models/exercice.rb b/app/models/exercice.rb index 6aba88c47..12169a663 100644 --- a/app/models/exercice.rb +++ b/app/models/exercice.rb @@ -1,16 +1,3 @@ -# == Schema Information -# -# Table name: exercices -# -# id :integer not null, primary key -# ca :string -# dateFinExercice :datetime -# date_fin_exercice :datetime -# date_fin_exercice_timestamp :integer -# created_at :datetime -# updated_at :datetime -# etablissement_id :integer -# class Exercice < ApplicationRecord belongs_to :etablissement, optional: false diff --git a/app/models/expert.rb b/app/models/expert.rb index 44c7d58ed..d86b69194 100644 --- a/app/models/expert.rb +++ b/app/models/expert.rb @@ -1,12 +1,3 @@ -# == Schema Information -# -# Table name: experts -# -# id :bigint not null, primary key -# created_at :datetime not null -# updated_at :datetime not null -# user_id :bigint not null -# class Expert < ApplicationRecord belongs_to :user has_many :experts_procedures diff --git a/app/models/experts_procedure.rb b/app/models/experts_procedure.rb index 438086376..41c58594f 100644 --- a/app/models/experts_procedure.rb +++ b/app/models/experts_procedure.rb @@ -1,15 +1,3 @@ -# == Schema Information -# -# Table name: experts_procedures -# -# id :bigint not null, primary key -# allow_decision_access :boolean default(FALSE), not null -# revoked_at :datetime -# created_at :datetime not null -# updated_at :datetime not null -# expert_id :bigint not null -# procedure_id :bigint not null -# class ExpertsProcedure < ApplicationRecord belongs_to :expert belongs_to :procedure diff --git a/app/models/export.rb b/app/models/export.rb index d9f3b4c8d..f5fcab31c 100644 --- a/app/models/export.rb +++ b/app/models/export.rb @@ -1,18 +1,3 @@ -# == Schema Information -# -# Table name: exports -# -# id :bigint not null, primary key -# format :string not null -# job_status :string default("pending"), not null -# key :text not null -# procedure_presentation_snapshot :jsonb -# statut :string default("tous") -# time_span_type :string default("everything"), not null -# created_at :datetime not null -# updated_at :datetime not null -# procedure_presentation_id :bigint -# class Export < ApplicationRecord include TransientModelsWithPurgeableJobConcern diff --git a/app/models/follow.rb b/app/models/follow.rb index 28710ecf3..1ec50e371 100644 --- a/app/models/follow.rb +++ b/app/models/follow.rb @@ -1,18 +1,3 @@ -# == Schema Information -# -# Table name: follows -# -# id :integer not null, primary key -# annotations_privees_seen_at :datetime not null -# avis_seen_at :datetime not null -# demande_seen_at :datetime not null -# messagerie_seen_at :datetime not null -# unfollowed_at :datetime -# created_at :datetime -# updated_at :datetime -# dossier_id :integer not null -# instructeur_id :integer not null -# class Follow < ApplicationRecord belongs_to :instructeur, optional: false belongs_to :dossier, optional: false diff --git a/app/models/france_connect_information.rb b/app/models/france_connect_information.rb index c41bef39f..2acace8a7 100644 --- a/app/models/france_connect_information.rb +++ b/app/models/france_connect_information.rb @@ -1,22 +1,3 @@ -# == Schema Information -# -# Table name: france_connect_informations -# -# id :integer not null, primary key -# birthdate :date -# birthplace :string -# data :jsonb -# email_france_connect :string -# family_name :string -# gender :string -# given_name :string -# merge_token :string -# merge_token_created_at :datetime -# created_at :datetime not null -# updated_at :datetime not null -# france_connect_particulier_id :string -# user_id :integer -# class FranceConnectInformation < ApplicationRecord MERGE_VALIDITY = 15.minutes diff --git a/app/models/geo_area.rb b/app/models/geo_area.rb index 22a40fa00..e34669759 100644 --- a/app/models/geo_area.rb +++ b/app/models/geo_area.rb @@ -1,16 +1,3 @@ -# == Schema Information -# -# Table name: geo_areas -# -# id :bigint not null, primary key -# geometry :jsonb -# properties :jsonb -# source :string -# created_at :datetime -# updated_at :datetime -# champ_id :bigint -# geo_reference_id :string -# class GeoArea < ApplicationRecord include ActionView::Helpers::NumberHelper belongs_to :champ, optional: false diff --git a/app/models/groupe_instructeur.rb b/app/models/groupe_instructeur.rb index 133d01711..87224cf7b 100644 --- a/app/models/groupe_instructeur.rb +++ b/app/models/groupe_instructeur.rb @@ -1,15 +1,3 @@ -# == Schema Information -# -# Table name: groupe_instructeurs -# -# id :bigint not null, primary key -# closed :boolean default(FALSE) -# label :text not null -# routing_rule :jsonb -# created_at :datetime not null -# updated_at :datetime not null -# procedure_id :bigint not null -# class GroupeInstructeur < ApplicationRecord include Logic DEFAUT_LABEL = 'défaut' diff --git a/app/models/individual.rb b/app/models/individual.rb index f58f83639..7f1c40c86 100644 --- a/app/models/individual.rb +++ b/app/models/individual.rb @@ -1,16 +1,3 @@ -# == Schema Information -# -# Table name: individuals -# -# id :integer not null, primary key -# birthdate :date -# gender :string -# nom :string -# prenom :string -# created_at :datetime -# updated_at :datetime -# dossier_id :integer -# class Individual < ApplicationRecord belongs_to :dossier, optional: false diff --git a/app/models/instructeur.rb b/app/models/instructeur.rb index c6685b57c..5a5f92b16 100644 --- a/app/models/instructeur.rb +++ b/app/models/instructeur.rb @@ -1,16 +1,3 @@ -# == Schema Information -# -# Table name: instructeurs -# -# id :integer not null, primary key -# bypass_email_login_token :boolean default(FALSE), not null -# encrypted_login_token :text -# login_token_created_at :datetime -# created_at :datetime -# updated_at :datetime -# agent_connect_id :string -# user_id :bigint not null -# class Instructeur < ApplicationRecord has_and_belongs_to_many :administrateurs diff --git a/app/models/invite.rb b/app/models/invite.rb index dbdfd3a67..e8d88839c 100644 --- a/app/models/invite.rb +++ b/app/models/invite.rb @@ -1,16 +1,3 @@ -# == Schema Information -# -# Table name: invites -# -# id :integer not null, primary key -# email :string -# email_sender :string -# message :text -# created_at :datetime -# updated_at :datetime -# dossier_id :integer -# user_id :integer -# class Invite < ApplicationRecord include EmailSanitizableConcern diff --git a/app/models/merge_log.rb b/app/models/merge_log.rb index 8ddb158bb..5e4a14ade 100644 --- a/app/models/merge_log.rb +++ b/app/models/merge_log.rb @@ -1,14 +1,3 @@ -# == Schema Information -# -# Table name: merge_logs -# -# id :bigint not null, primary key -# from_user_email :string not null -# created_at :datetime not null -# updated_at :datetime not null -# from_user_id :bigint not null -# user_id :bigint not null -# class MergeLog < ApplicationRecord belongs_to :user end diff --git a/app/models/module_api_carto.rb b/app/models/module_api_carto.rb index e2a878c69..ffc6d8dd4 100644 --- a/app/models/module_api_carto.rb +++ b/app/models/module_api_carto.rb @@ -1,16 +1,3 @@ -# == Schema Information -# -# Table name: module_api_cartos -# -# id :integer not null, primary key -# cadastre :boolean default(FALSE) -# migrated :boolean -# quartiers_prioritaires :boolean default(FALSE) -# use_api_carto :boolean default(FALSE) -# created_at :datetime -# updated_at :datetime -# procedure_id :integer -# class ModuleAPICarto < ApplicationRecord belongs_to :procedure, optional: false end diff --git a/app/models/procedure.rb b/app/models/procedure.rb index 33b9a7ae5..b3a08198a 100644 --- a/app/models/procedure.rb +++ b/app/models/procedure.rb @@ -1,69 +1,3 @@ -# == Schema Information -# -# Table name: procedures -# -# id :integer not null, primary key -# aasm_state :string default("brouillon") -# allow_expert_messaging :boolean default(TRUE), not null -# allow_expert_review :boolean default(TRUE), not null -# api_entreprise_token :string -# api_particulier_scopes :text default([]), is an Array -# api_particulier_sources :jsonb -# ask_birthday :boolean default(FALSE), not null -# auto_archive_on :date -# cadre_juridique :string -# cloned_from_library :boolean default(FALSE) -# closed_at :datetime -# declarative_with_state :string -# description :string -# description_pj :string -# description_target_audience :string -# dossiers_count_computed_at :datetime -# duree_conservation_dossiers_dans_ds :integer -# duree_conservation_etendue_par_ds :boolean default(FALSE), not null -# encrypted_api_particulier_token :string -# estimated_dossiers_count :integer -# estimated_duration_visible :boolean default(TRUE), not null -# euro_flag :boolean default(FALSE) -# experts_require_administrateur_invitation :boolean default(FALSE) -# for_individual :boolean default(FALSE) -# hidden_at :datetime -# instructeurs_self_management_enabled :boolean -# juridique_required :boolean default(TRUE) -# libelle :string -# lien_dpo :string -# lien_dpo_error :text -# lien_notice :string -# lien_notice_error :text -# lien_site_web :string -# max_duree_conservation_dossiers_dans_ds :integer default(12), not null -# migrated_champ_routage :boolean -# monavis_embed :text -# opendata :boolean default(TRUE) -# organisation :string -# path :string not null -# piece_justificative_multiple :boolean default(TRUE), not null -# procedure_expires_when_termine_enabled :boolean default(TRUE) -# published_at :datetime -# routing_criteria_name :text default("Votre ville") -# routing_enabled :boolean -# sva_svr :jsonb not null -# tags :text default([]), is an Array -# unpublished_at :datetime -# web_hook_url :string -# whitelisted_at :datetime -# created_at :datetime not null -# updated_at :datetime not null -# canonical_procedure_id :bigint -# defaut_groupe_instructeur_id :bigint -# draft_revision_id :bigint -# parent_procedure_id :bigint -# published_revision_id :bigint -# replaced_by_procedure_id :bigint -# service_id :bigint -# zone_id :bigint -# - class Procedure < ApplicationRecord include ProcedureStatsConcern include EncryptableConcern diff --git a/app/models/procedure_presentation.rb b/app/models/procedure_presentation.rb index a068d4821..690df4735 100644 --- a/app/models/procedure_presentation.rb +++ b/app/models/procedure_presentation.rb @@ -1,15 +1,3 @@ -# == Schema Information -# -# Table name: procedure_presentations -# -# id :integer not null, primary key -# displayed_fields :jsonb not null -# filters :jsonb not null -# sort :jsonb not null -# created_at :datetime -# updated_at :datetime -# assign_to_id :integer -# class ProcedurePresentation < ApplicationRecord EXTRA_SORT_COLUMNS = { 'notifications' => ['notifications'], diff --git a/app/models/procedure_revision.rb b/app/models/procedure_revision.rb index 0de68a045..8f065d4ee 100644 --- a/app/models/procedure_revision.rb +++ b/app/models/procedure_revision.rb @@ -1,16 +1,3 @@ -# == Schema Information -# -# Table name: procedure_revisions -# -# id :bigint not null, primary key -# migrated_champ_routage :boolean -# published_at :datetime -# created_at :datetime not null -# updated_at :datetime not null -# attestation_template_id :bigint -# dossier_submitted_message_id :bigint -# procedure_id :bigint not null -# class ProcedureRevision < ApplicationRecord self.implicit_order_column = :created_at belongs_to :procedure, -> { with_discarded }, inverse_of: :revisions, optional: false diff --git a/app/models/procedure_revision_type_de_champ.rb b/app/models/procedure_revision_type_de_champ.rb index 90fb598e8..b5396351e 100644 --- a/app/models/procedure_revision_type_de_champ.rb +++ b/app/models/procedure_revision_type_de_champ.rb @@ -1,15 +1,3 @@ -# == Schema Information -# -# Table name: procedure_revision_types_de_champ -# -# id :bigint not null, primary key -# position :integer not null -# created_at :datetime not null -# updated_at :datetime not null -# parent_id :bigint -# revision_id :bigint not null -# type_de_champ_id :bigint not null -# class ProcedureRevisionTypeDeChamp < ApplicationRecord belongs_to :revision, class_name: 'ProcedureRevision' belongs_to :type_de_champ diff --git a/app/models/safe_mailer.rb b/app/models/safe_mailer.rb index b4114e41a..9ccc83aef 100644 --- a/app/models/safe_mailer.rb +++ b/app/models/safe_mailer.rb @@ -1,12 +1,3 @@ -# == Schema Information -# -# Table name: safe_mailers -# -# id :bigint not null, primary key -# forced_delivery_method :string -# created_at :datetime not null -# updated_at :datetime not null -# class SafeMailer < ApplicationRecord before_create do raise if SafeMailer.count == 1 diff --git a/app/models/service.rb b/app/models/service.rb index 5bd98d3a5..ed1209663 100644 --- a/app/models/service.rb +++ b/app/models/service.rb @@ -1,23 +1,3 @@ -# == Schema Information -# -# Table name: services -# -# id :bigint not null, primary key -# adresse :text -# email :string -# etablissement_infos :jsonb -# etablissement_lat :decimal(10, 6) -# etablissement_lng :decimal(10, 6) -# horaires :text -# nom :string not null -# organisme :string -# siret :string -# telephone :string -# type_organisme :string not null -# created_at :datetime not null -# updated_at :datetime not null -# administrateur_id :bigint -# class Service < ApplicationRecord has_many :procedures belongs_to :administrateur, optional: false diff --git a/app/models/stat.rb b/app/models/stat.rb index 77e0ace98..06dec2a55 100644 --- a/app/models/stat.rb +++ b/app/models/stat.rb @@ -1,21 +1,3 @@ -# == Schema Information -# -# Table name: stats -# -# id :bigint not null, primary key -# administrations_partenaires :bigint default(0) -# dossiers_brouillon :bigint default(0) -# dossiers_cumulative :jsonb not null -# dossiers_depose_avant_30_jours :bigint default(0) -# dossiers_deposes_entre_60_et_30_jours :bigint default(0) -# dossiers_en_construction :bigint default(0) -# dossiers_en_instruction :bigint default(0) -# dossiers_in_the_last_4_months :jsonb not null -# dossiers_not_brouillon :bigint default(0) -# dossiers_termines :bigint default(0) -# created_at :datetime not null -# updated_at :datetime not null -# class Stat < ApplicationRecord class << self def update_stats diff --git a/app/models/super_admin.rb b/app/models/super_admin.rb index 8e87e73f6..b750365a0 100644 --- a/app/models/super_admin.rb +++ b/app/models/super_admin.rb @@ -1,30 +1,3 @@ -# == Schema Information -# -# Table name: super_admins -# -# id :integer not null, primary key -# consumed_timestep :integer -# current_sign_in_at :datetime -# current_sign_in_ip :string -# email :string default(""), not null -# encrypted_otp_secret :string -# encrypted_otp_secret_iv :string -# encrypted_otp_secret_salt :string -# encrypted_password :string default(""), not null -# failed_attempts :integer default(0), not null -# last_sign_in_at :datetime -# last_sign_in_ip :string -# locked_at :datetime -# otp_required_for_login :boolean -# otp_secret :string -# remember_created_at :datetime -# reset_password_sent_at :datetime -# reset_password_token :string -# sign_in_count :integer default(0), not null -# unlock_token :string -# created_at :datetime -# updated_at :datetime -# class SuperAdmin < ApplicationRecord include PasswordComplexityConcern diff --git a/app/models/targeted_user_link.rb b/app/models/targeted_user_link.rb index 2d9d358e1..2d3d53660 100644 --- a/app/models/targeted_user_link.rb +++ b/app/models/targeted_user_link.rb @@ -1,15 +1,3 @@ -# == Schema Information -# -# Table name: targeted_user_links -# -# id :uuid not null, primary key -# target_context :string not null -# target_model_type :string not null -# created_at :datetime not null -# updated_at :datetime not null -# target_model_id :bigint not null -# user_id :bigint -# class TargetedUserLink < ApplicationRecord belongs_to :user, optional: true belongs_to :target_model, polymorphic: true, optional: false diff --git a/app/models/traitement.rb b/app/models/traitement.rb index ebf3ee0d0..6c407a154 100644 --- a/app/models/traitement.rb +++ b/app/models/traitement.rb @@ -1,16 +1,3 @@ -# == Schema Information -# -# Table name: traitements -# -# id :bigint not null, primary key -# instructeur_email :string -# motivation :string -# process_expired :boolean -# process_expired_migrated :boolean default(FALSE) -# processed_at :datetime -# state :string -# dossier_id :bigint -# class Traitement < ApplicationRecord belongs_to :dossier, optional: false diff --git a/app/models/trusted_device_token.rb b/app/models/trusted_device_token.rb index 53ba9fa9c..ddb132961 100644 --- a/app/models/trusted_device_token.rb +++ b/app/models/trusted_device_token.rb @@ -1,13 +1,3 @@ -# == Schema Information -# -# Table name: trusted_device_tokens -# -# id :bigint not null, primary key -# token :string -# created_at :datetime not null -# updated_at :datetime not null -# instructeur_id :bigint -# class TrustedDeviceToken < ApplicationRecord LOGIN_TOKEN_VALIDITY = 1.week LOGIN_TOKEN_YOUTH = 15.minutes diff --git a/app/models/type_de_champ.rb b/app/models/type_de_champ.rb index e6dc16c57..1d7be7f07 100644 --- a/app/models/type_de_champ.rb +++ b/app/models/type_de_champ.rb @@ -1,19 +1,3 @@ -# == Schema Information -# -# Table name: types_de_champ -# -# id :integer not null, primary key -# condition :jsonb -# description :text -# libelle :string -# mandatory :boolean default(FALSE) -# options :jsonb -# private :boolean default(FALSE), not null -# type_champ :string -# created_at :datetime -# updated_at :datetime -# stable_id :bigint -# class TypeDeChamp < ApplicationRecord self.ignored_columns += [:migrated_parent, :revision_id, :parent_id, :order_place] diff --git a/app/models/user.rb b/app/models/user.rb index 85920d288..9aabfe35f 100644 --- a/app/models/user.rb +++ b/app/models/user.rb @@ -1,35 +1,3 @@ -# == Schema Information -# -# Table name: users -# -# id :integer not null, primary key -# blocked_at :datetime -# blocked_reason :text -# confirmation_sent_at :datetime -# confirmation_token :string -# confirmed_at :datetime -# current_sign_in_at :datetime -# current_sign_in_ip :string -# email :string default(""), not null -# encrypted_password :string default(""), not null -# failed_attempts :integer default(0), not null -# last_sign_in_at :datetime -# last_sign_in_ip :string -# locale :string -# locked_at :datetime -# loged_in_with_france_connect :string default(NULL) -# remember_created_at :datetime -# reset_password_sent_at :datetime -# reset_password_token :string -# sign_in_count :integer default(0), not null -# siret :string -# team_account :boolean default(FALSE) -# unconfirmed_email :text -# unlock_token :string -# created_at :datetime -# updated_at :datetime -# requested_merge_into_id :bigint -# class User < ApplicationRecord include EmailSanitizableConcern include PasswordComplexityConcern diff --git a/app/models/zone.rb b/app/models/zone.rb index e4f2bce9e..cf8c806c2 100644 --- a/app/models/zone.rb +++ b/app/models/zone.rb @@ -1,14 +1,3 @@ -# == Schema Information -# -# Table name: zones -# -# id :bigint not null, primary key -# acronym :string not null -# label :string -# tchap_hs :string default([]), is an Array -# created_at :datetime not null -# updated_at :datetime not null -# class Zone < ApplicationRecord validates :acronym, presence: true, uniqueness: true has_many :labels, -> { order(designated_on: :desc) }, class_name: 'ZoneLabel', inverse_of: :zone diff --git a/app/models/zone_label.rb b/app/models/zone_label.rb index 7a3a55eae..926488b75 100644 --- a/app/models/zone_label.rb +++ b/app/models/zone_label.rb @@ -1,14 +1,3 @@ -# == Schema Information -# -# Table name: zone_labels -# -# id :bigint not null, primary key -# designated_on :date not null -# name :string not null -# created_at :datetime not null -# updated_at :datetime not null -# zone_id :bigint not null -# class ZoneLabel < ApplicationRecord belongs_to :zone end From fd24f283debc08c366fca2d3b5a39c45577941a3 Mon Sep 17 00:00:00 2001 From: Paul Chavard Date: Wed, 2 Aug 2023 11:43:30 +0200 Subject: [PATCH 3/3] chore(schema): update timestamp --- db/schema.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/db/schema.rb b/db/schema.rb index 4f486cfdc..6e4313725 100644 --- a/db/schema.rb +++ b/db/schema.rb @@ -10,7 +10,7 @@ # # It's strongly recommended that you check this file into your version control system. -ActiveRecord::Schema[7.0].define(version: 2023_07_18_113920) do +ActiveRecord::Schema[7.0].define(version: 2023_08_01_121131) do # These are extensions that must be enabled in order to support this database enable_extension "pgcrypto" enable_extension "plpgsql"