Files
old-holivud2/app/models/casting_submission.rb

16 lines
417 B
Ruby
Raw Normal View History

2020-07-17 04:50:04 +02:00
class CastingSubmission < ApplicationRecord
2020-07-15 11:57:21 +02:00
belongs_to :casting_call
has_many_attached :files
2020-07-22 13:37:34 +00:00
has_one_attached :interview_recording
2020-07-15 11:57:21 +02:00
has_secure_token
validates :performer_name, presence: true
scope :completed, -> { where.not(interviewed_at: nil) }
def zip_file_name
"#{self.casting_call.title.parameterize}_#{self.performer_name.parameterize}_#{Time.now.strftime('%Y-%m-%d_%H-%M-%S')}"
end
end