Sha256: 07305c13ab7a4d37d88120c9601b9842329c5ac825d77f8b32d616d4602e4921
Contents?: true
Size: 928 Bytes
Versions: 9
Compression:
Stored size: 928 Bytes
Contents
module Logistics module Core class BroadGaugeBb < ApplicationRecord validates :length, :width, :height, :actual_weight, presence: true, allow_blank: false validates :break_bulk_unit_id, uniqueness: {scope: [:break_bulk_unit_id, :length, :width, :height, :actual_weight]} belongs_to :break_bulk_unit def self.fetch_all result = [] broad_gauges = BroadGaugeBb.all broad_gauges.each do |broad_gauge| result.push({id: broad_gauge.id, break_bulk_unit_id: broad_gauge.break_bulk_unit_id, break_bulk_unit_name: broad_gauge.break_bulk_unit.name, length: broad_gauge.length, width: broad_gauge.width, height: broad_gauge.height, actual_weight: broad_gauge.actual_weight}) end return result end end end end
Version data entries
9 entries across 9 versions & 1 rubygems