rename to templates

This commit is contained in:
Alex Turchyn
2023-05-31 23:19:20 +03:00
parent 98fc9d964a
commit 4a303cb423
59 changed files with 248 additions and 264 deletions
+1 -1
View File
@@ -12,7 +12,7 @@
class Account < ApplicationRecord
has_many :users, dependent: :destroy
has_many :encrypted_configs, dependent: :destroy
has_many :flows, dependent: :destroy
has_many :templates, dependent: :destroy
has_many :active_users, -> { active }, dependent: :destroy,
inverse_of: :account, class_name: 'User'
end
+6 -6
View File
@@ -16,20 +16,20 @@
# values :string not null
# created_at :datetime not null
# updated_at :datetime not null
# flow_id :bigint not null
# template_id :bigint not null
#
# Indexes
#
# index_submissions_on_email (email)
# index_submissions_on_flow_id (flow_id)
# index_submissions_on_slug (slug) UNIQUE
# index_submissions_on_email (email)
# index_submissions_on_slug (slug) UNIQUE
# index_submissions_on_template_id (template_id)
#
# Foreign Keys
#
# fk_rails_... (flow_id => flows.id)
# fk_rails_... (template_id => templates.id)
#
class Submission < ApplicationRecord
belongs_to :flow
belongs_to :template
attribute :values, :string, default: -> { {} }
attribute :slug, :string, default: -> { SecureRandom.base58(8) }
@@ -2,7 +2,7 @@
# == Schema Information
#
# Table name: flows
# Table name: templates
#
# id :bigint not null, primary key
# deleted_at :datetime
@@ -17,16 +17,16 @@
#
# Indexes
#
# index_flows_on_account_id (account_id)
# index_flows_on_author_id (author_id)
# index_flows_on_slug (slug) UNIQUE
# index_templates_on_account_id (account_id)
# index_templates_on_author_id (author_id)
# index_templates_on_slug (slug) UNIQUE
#
# Foreign Keys
#
# fk_rails_... (account_id => accounts.id)
# fk_rails_... (author_id => users.id)
#
class Flow < ApplicationRecord
class Template < ApplicationRecord
belongs_to :author, class_name: 'User'
belongs_to :account