Sha256: ab25cceb494b7e40e325882a7fa63a260e873c3df3cf2e1d7d8938b993b320fa

Contents?: true

Size: 436 Bytes

Versions: 28

Compression:

Stored size: 436 Bytes

Contents

module Comee
  module Core
    class DeliveryNote < ApplicationRecord
      before_validation :generate_reference_no, if: proc { |dn| dn.reference_no.nil? }

      belongs_to :pod
      has_many :shipment_instruction_items

      validates :reference_no, presence: true, uniqueness: true

      def generate_reference_no
        self.reference_no = Util.generate_number("DeliveryNote", "reference_no", "DN")
      end
    end
  end
end

Version data entries

28 entries across 28 versions & 1 rubygems

Version Path
comee_core-0.3.62 app/models/comee/core/delivery_note.rb
comee_core-0.3.61 app/models/comee/core/delivery_note.rb
comee_core-0.3.60 app/models/comee/core/delivery_note.rb
comee_core-0.3.59 app/models/comee/core/delivery_note.rb
comee_core-0.3.58 app/models/comee/core/delivery_note.rb
comee_core-0.3.57 app/models/comee/core/delivery_note.rb
comee_core-0.3.56 app/models/comee/core/delivery_note.rb
comee_core-0.3.55 app/models/comee/core/delivery_note.rb
comee_core-0.3.54 app/models/comee/core/delivery_note.rb
comee_core-0.3.53 app/models/comee/core/delivery_note.rb
comee_core-0.3.51 app/models/comee/core/delivery_note.rb
comee_core-0.3.50 app/models/comee/core/delivery_note.rb
comee_core-0.3.49 app/models/comee/core/delivery_note.rb
comee_core-0.3.48 app/models/comee/core/delivery_note.rb
comee_core-0.3.47 app/models/comee/core/delivery_note.rb
comee_core-0.3.46 app/models/comee/core/delivery_note.rb
comee_core-0.3.45 app/models/comee/core/delivery_note.rb
comee_core-0.3.44 app/models/comee/core/delivery_note.rb
comee_core-0.3.43 app/models/comee/core/delivery_note.rb
comee_core-0.3.42 app/models/comee/core/delivery_note.rb