add source to templates

This commit is contained in:
Alex Turchyn
2023-08-19 22:08:17 +03:00
parent 46f350217a
commit 8e39f0078d
3 changed files with 23 additions and 1 deletions
+2
View File
@@ -10,6 +10,7 @@
# name :string not null
# schema :text not null
# slug :string not null
# source :text not null
# submitters :text not null
# created_at :datetime not null
# updated_at :datetime not null
@@ -37,6 +38,7 @@ class Template < ApplicationRecord
attribute :schema, :string, default: -> { [] }
attribute :submitters, :string, default: -> { [{ name: DEFAULT_SUBMITTER_NAME, uuid: SecureRandom.uuid }] }
attribute :slug, :string, default: -> { SecureRandom.base58(14) }
attribute :source, :string, default: 'native'
serialize :fields, JSON
serialize :schema, JSON