Sha256: 98a1a8ca821fce1caa0bab3fabc8f60fd845a9916aa9fbf52da24b1108432cf0

Contents?: true

Size: 485 Bytes

Versions: 3

Compression:

Stored size: 485 Bytes

Contents

module Ecom
  module Core
    class WorkPackage < ApplicationRecord
      belongs_to :project
      belongs_to :site_engineer, class_name: 'Ecom::Core::User', optional: true
      belongs_to :project_manager, class_name: 'Ecom::Core::User', optional: true

      validates :code, :name, presence: true
      validates :code, uniqueness: true
      validates :budget, numericality: true, unless: proc { budget.nil? }

      has_many :tasks
      has_many :work_orders
    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
ecom_core-1.3.14 app/models/ecom/core/work_package.rb
ecom_core-1.3.13 app/models/ecom/core/work_package.rb
ecom_core-1.3.12 app/models/ecom/core/work_package.rb