feat(repetition): make champ repetition discardable

This commit is contained in:
Paul Chavard 2024-10-10 11:01:20 +02:00
parent e44a3d3016
commit 3da8c4b672
No known key found for this signature in database
3 changed files with 16 additions and 0 deletions

View file

@ -23,6 +23,14 @@ class Champs::RepetitionChamp < Champ
rows.last&.first&.focusable_input_id rows.last&.first&.focusable_input_id
end end
def discarded?
discarded_at.present?
end
def discard!
touch(:discarded_at)
end
def search_terms def search_terms
# The user cannot enter any information here so it doesnt make much sense to search # The user cannot enter any information here so it doesnt make much sense to search
end end

View file

@ -0,0 +1,7 @@
# frozen_string_literal: true
class AddDiscardedAtToChamps < ActiveRecord::Migration[7.0]
def change
add_column :champs, :discarded_at, :datetime
end
end

View file

@ -250,6 +250,7 @@ ActiveRecord::Schema[7.0].define(version: 2024_11_26_145420) do
create_table "champs", id: :serial, force: :cascade do |t| create_table "champs", id: :serial, force: :cascade do |t|
t.datetime "created_at", precision: nil t.datetime "created_at", precision: nil
t.jsonb "data" t.jsonb "data"
t.datetime "discarded_at"
t.integer "dossier_id" t.integer "dossier_id"
t.integer "etablissement_id" t.integer "etablissement_id"
t.string "external_id" t.string "external_id"