feat(repetition): make champ repetition discardable
This commit is contained in:
parent
e44a3d3016
commit
3da8c4b672
3 changed files with 16 additions and 0 deletions
|
@ -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 doesn’t make much sense to search
|
# The user cannot enter any information here so it doesn’t make much sense to search
|
||||||
end
|
end
|
||||||
|
|
7
db/migrate/20241007174301_add_discarded_at_to_champs.rb
Normal file
7
db/migrate/20241007174301_add_discarded_at_to_champs.rb
Normal 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
|
|
@ -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"
|
||||||
|
|
Loading…
Reference in a new issue