Sha256: 03d78cc7b22969717b43d696c072928468e9911a421f6baee28c4e2814b2a5fc

Contents?: true

Size: 687 Bytes

Versions: 20

Compression:

Stored size: 687 Bytes

Contents

module Ecom
  module Core
    class DimensionElement < ApplicationRecord
      LENGTH = 'Length'.freeze
      WIDTH = 'Width'.freeze
      HEIGHT = 'Height'.freeze
      RADIUS = 'Radius'.freeze
      DIAMETER = 'Diameter'.freeze
      DIMENSION_ELEMENT_NAMES = %w[LENGTH WIDTH HEIGHT RADIUS DIAMETER].freeze

      validates :work_product_id, :work_product, :measurement_unit_id, :measurement_unit,
                :amount, :dimension_element_name, presence: true

      validates :dimension_element_name, inclusion: DIMENSION_ELEMENT_NAMES

      validates :amount, numericality: { greater_than: 0 }

      belongs_to :work_product
      belongs_to :measurement_unit
    end
  end
end

Version data entries

20 entries across 20 versions & 1 rubygems

Version Path
ecom_core-1.3.14 app/models/ecom/core/dimension_element.rb
ecom_core-1.3.13 app/models/ecom/core/dimension_element.rb
ecom_core-1.3.12 app/models/ecom/core/dimension_element.rb
ecom_core-1.3.11 app/models/ecom/core/dimension_element.rb
ecom_core-1.3.10 app/models/ecom/core/dimension_element.rb
ecom_core-1.3.9 app/models/ecom/core/dimension_element.rb
ecom_core-1.3.8 app/models/ecom/core/dimension_element.rb
ecom_core-1.3.7 app/models/ecom/core/dimension_element.rb
ecom_core-1.3.6 app/models/ecom/core/dimension_element.rb
ecom_core-1.3.5 app/models/ecom/core/dimension_element.rb
ecom_core-1.3.4 app/models/ecom/core/dimension_element.rb
ecom_core-1.3.3 app/models/ecom/core/dimension_element.rb
ecom_core-1.3.2 app/models/ecom/core/dimension_element.rb
ecom_core-1.3.1 app/models/ecom/core/dimension_element.rb
ecom_core-1.3.0 app/models/ecom/core/dimension_element.rb
ecom_core-1.2.36 app/models/ecom/core/dimension_element.rb
ecom_core-1.2.35 app/models/ecom/core/dimension_element.rb
ecom_core-1.2.34 app/models/ecom/core/dimension_element.rb
ecom_core-1.2.33 app/models/ecom/core/dimension_element.rb
ecom_core-1.2.32 app/models/ecom/core/dimension_element.rb