Sha256: 01ddcc4b70d80ddcabfcc18c0863d94d0c72c0bff509d64bb424573e58fe6982

Contents?: true

Size: 753 Bytes

Versions: 1

Compression:

Stored size: 753 Bytes

Contents

module Skr

    module BusinessEntity

        extend ActiveSupport::Concern

        included do
            has_random_hash_code
            has_code_identifier from: 'name'

            belongs_to :billing_address,  class_name: 'Skr::Address',     export: { writable: true }
            belongs_to :shipping_address, class_name: 'Skr::Address',     export: { writable: true }
            belongs_to :terms,            class_name: 'Skr::PaymentTerm', export: { writable: true }

            delegate_and_export :terms_code, :terms_description

            validates :name,  presence: true
            validates :terms, :billing_address, :shipping_address, set: true

            before_validation :set_defaults, :on=>:create
        end

    end

end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
stockor-core-0.2 lib/skr/business_entity.rb