Sha256: 5f380fd4174cfe9f86250a3033eaa6ff4b1f68339a50c63203920cf0d821604a
Contents?: true
Size: 543 Bytes
Versions: 9
Compression:
Stored size: 543 Bytes
Contents
module Logistics module Core class WarehouseRatePeriod < ApplicationRecord validates :warehouse_id, :from, :to, :rate_period, presence: true belongs_to :warehouse def self.generate_rate_period_matrix warehouses = Warehouse.all warehouses.each { |warehouse| w = WarehouseRatePeriod.where('warehouse_id' => warehouse.id) if w.count == 0 WarehouseRatePeriod.create('warehouse_id' => warehouse.id, 'from' => 0, 'to' => 0) end } end end end end
Version data entries
9 entries across 9 versions & 1 rubygems