preserve template fields per submission

This commit is contained in:
Alex Turchyn
2023-07-26 09:58:50 +03:00
parent a92d1d82c1
commit e1eb2da6f9
11 changed files with 78 additions and 21 deletions
+13 -6
View File
@@ -4,12 +4,15 @@
#
# Table name: submissions
#
# id :bigint not null, primary key
# deleted_at :datetime
# created_at :datetime not null
# updated_at :datetime not null
# created_by_user_id :bigint
# template_id :bigint not null
# id :bigint not null, primary key
# deleted_at :datetime
# template_fields :text
# template_schema :text
# template_submitters :text
# created_at :datetime not null
# updated_at :datetime not null
# created_by_user_id :bigint
# template_id :bigint not null
#
# Indexes
#
@@ -27,5 +30,9 @@ class Submission < ApplicationRecord
has_many :submitters, dependent: :destroy
serialize :template_fields, JSON
serialize :template_schema, JSON
serialize :template_submitters, JSON
scope :active, -> { where(deleted_at: nil) }
end