Cast me sync

This commit is contained in:
Senad Uka
2020-07-17 04:50:04 +02:00
parent 96b31b71cf
commit e3acdb4d0e
53 changed files with 678 additions and 635 deletions

View File

@@ -5,7 +5,7 @@ class Account < ApplicationRecord
has_many :users, through: :account_auths
has_many :projects, dependent: :destroy
has_many :casting_calls, through: :projects
has_many :casting_call_interviews, through: :projects
has_many :casting_submissions, through: :projects
has_many :videos, through: :projects
has_many :contract_templates, through: :projects
@@ -62,7 +62,7 @@ class Account < ApplicationRecord
MiscRelease.where(project: projects),
MatchingRequest.where(project: projects),
CastingCall.where(project: projects),
self.casting_call_interviews,
self.casting_submissions,
self
])).sum(:byte_size).to_f
end

View File

@@ -1,6 +1,6 @@
class CastingCall < ApplicationRecord
belongs_to :project
has_many :casting_call_interviews, dependent: :destroy
has_many :casting_submissions, dependent: :destroy
has_secure_token

View File

@@ -1,4 +1,4 @@
class CastingCallInterview < ApplicationRecord
class CastingSubmission < ApplicationRecord
belongs_to :casting_call
has_many_attached :files
@@ -33,6 +33,6 @@ class CastingCallInterview < ApplicationRecord
private
def invalid_meeting_url_message
I18n.t('casting_call_interviews.validation_errors.invalid_meeting_url')
I18n.t('casting_submissions.validation_errors.invalid_meeting_url')
end
end

View File

@@ -16,7 +16,7 @@ class Project < ApplicationRecord
has_many :medical_releases, dependent: :destroy
has_many :misc_releases, dependent: :destroy
has_many :casting_calls, dependent: :destroy
has_many :casting_call_interviews, through: :casting_calls
has_many :casting_submissions, through: :casting_calls
has_many :videos, dependent: :destroy
has_many :imports, dependent: :destroy
has_many :contract_templates, dependent: :destroy