module Ecom module Core class Site < ApplicationRecord ACTIVE = 'Active'.freeze INACTIVE = 'Inactive'.freeze STATUSES = [ACTIVE, INACTIVE].freeze validates :name, :project_id, :project, :address, :status, presence: true validates :status, inclusion: STATUSES belongs_to :project has_many :site_crews has_many :crews, through: :site_crews end end end