module Ecom module Core class Project < ApplicationRecord belongs_to :employer, class_name: 'Ecom::Core::Stakeholder' belongs_to :contractor, class_name: 'Ecom::Core::Stakeholder' belongs_to :consultant, class_name: 'Ecom::Core::Stakeholder' belongs_to :project_manager, class_name: 'Ecom::Core::Stakeholder' belongs_to :task_template belongs_to :currency belongs_to :company has_many :project_crews has_many :crews, through: :project_crews validates :name, :location, :contract_number, :date_contract_signed, :commencement_date, :completion_date, :contract_amount, :advance_payment, :retention, presence: true end end end