Sha256: 001fd12bc76ed7b976216ed5214f8252b76b380d729069a4c0b22fe6a60e923b
Contents?: true
Size: 582 Bytes
Versions: 9
Compression:
Stored size: 582 Bytes
Contents
module Logistics module Core class DemurrageRatePeriod < ApplicationRecord validates :carrier_agent, :from, :to, :rate_period, presence: true belongs_to :carrier_agent def self.generate_carrier_agent_matrix carrier_agents = CarrierAgent.all carrier_agents.each { |carrier_agent| ca = DemurrageRatePeriod.where('carrier_agent_id' => carrier_agent.id) if ca.count == 0 DemurrageRatePeriod.create('carrier_agent_id' => carrier_agent.id, 'from' => 0, 'to' => 0) end } end end end end
Version data entries
9 entries across 9 versions & 1 rubygems