Sha256: edb94eb6ef0cd80a9431f99ab4f9633640c222be0dca007f2153152dd927ab30

Contents?: true

Size: 589 Bytes

Versions: 2

Compression:

Stored size: 589 Bytes

Contents

require 'subj_models/concerns/comprising_external_id'

module SubjModels

  module OrderDeliveryCourier

    def self.included(including_class)

      including_class.class_eval do

        include SubjModels::ComprisingExternalId

        belongs_to :order
        belongs_to :city

        validates :user_first_name, :user_last_name, :delivery_address, :street_name,
                  :house_number, :delivery_time,  presence: true

        scope :order_id, -> (order_id) { parent_id_scope("order", order_id) }

      end

    end

    def to_s
      id.to_s # TODO
    end

  end

end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
subj_models-0.4.1 lib/subj_models/order_delivery_courier.rb
subj_models-0.4 lib/subj_models/order_delivery_courier.rb