Files
docuseal/app/models/completed_submitter.rb
T

38 lines
1.4 KiB
Ruby
Raw Normal View History

2024-10-22 22:29:24 +03:00
# frozen_string_literal: true
# == Schema Information
#
# Table name: completed_submitters
#
# id :bigint not null, primary key
# completed_at :datetime not null
2025-11-21 11:27:28 +02:00
# is_first :boolean
# sms_count :integer not null
# source :string not null
# verification_method :string
# created_at :datetime not null
# updated_at :datetime not null
# account_id :bigint not null
# submission_id :bigint not null
# submitter_id :bigint not null
# template_id :bigint
2024-10-22 22:29:24 +03:00
#
# Indexes
#
2025-11-21 11:45:19 +02:00
# index_completed_submitters_account_id_completed_at_is_first (account_id,completed_at) WHERE (is_first = true)
# index_completed_submitters_on_account_id_and_completed_at (account_id,completed_at)
# index_completed_submitters_on_submission_id (submission_id) UNIQUE WHERE (is_first = true)
# index_completed_submitters_on_submitter_id (submitter_id) UNIQUE
2024-10-22 22:29:24 +03:00
#
class CompletedSubmitter < ApplicationRecord
belongs_to :submitter
belongs_to :submission
belongs_to :account
2025-05-31 15:15:25 +03:00
belongs_to :template, optional: true
2024-10-22 23:40:30 +03:00
has_many :completed_documents, dependent: :destroy,
primary_key: :submitter_id,
foreign_key: :submitter_id,
2025-09-03 12:50:16 +03:00
inverse_of: :completed_submitter
2024-10-22 22:29:24 +03:00
end