recruitment/app/models/employee_job_application.rb

16 lines
332 B
Ruby

class EmployeeJobApplication
include Mongoid::Document
include Mongoid::Timestamps
field :job
field :cover_letter
field :archived, type: Boolean, :default => false
belongs_to :employee_profile
scope :not_archived, ->{ where(:archived => false) }
def get_job
RecruitmentJob.find(self.job) rescue nil
end
end