add source to submissions

This commit is contained in:
Alex Turchyn
2023-08-05 19:20:06 +03:00
parent e4bb5466f5
commit 644b142798
8 changed files with 46 additions and 9 deletions
+10
View File
@@ -6,6 +6,7 @@
#
# id :bigint not null, primary key
# deleted_at :datetime
# source :text not null
# template_fields :text
# template_schema :text
# template_submitters :text
@@ -35,5 +36,14 @@ class Submission < ApplicationRecord
serialize :template_schema, JSON
serialize :template_submitters, JSON
attribute :source, :string, default: 'link'
scope :active, -> { where(deleted_at: nil) }
enum :source, {
invite: 'invite',
api: 'api',
embed: 'embed',
link: 'link'
}, scope: false, prefix: true
end