add exported_columns to export template model

Co-authored-by: mfo <mfo@users.noreply.github.com>
This commit is contained in:
Christophe Robillard 2024-10-25 14:21:45 +02:00 committed by mfo
parent b2c3887520
commit 94b3655ff7
No known key found for this signature in database
GPG key ID: 7CE3E1F5B794A8EC
3 changed files with 10 additions and 0 deletions

View file

@ -15,6 +15,8 @@ class ExportTemplate < ApplicationRecord
attribute :export_pdf, :export_item
attribute :pjs, :export_item, array: true
attribute :exported_columns, :exported_column, array: true
before_validation :ensure_pjs_are_legit
validates_with ExportTemplateValidator

View file

@ -0,0 +1,7 @@
# frozen_string_literal: true
class AddColumnsToExportTemplate < ActiveRecord::Migration[7.0]
def change
add_column :export_templates, :exported_columns, :jsonb, array: true, default: [], null: false
end
end

View file

@ -626,6 +626,7 @@ ActiveRecord::Schema[7.0].define(version: 2024_11_12_090128) do
t.datetime "created_at", null: false
t.jsonb "dossier_folder", null: false
t.jsonb "export_pdf", null: false
t.jsonb "exported_columns", default: [], null: false, array: true
t.bigint "groupe_instructeur_id", null: false
t.string "kind", null: false
t.string "name", null: false