Sha256: 9a63a4d42b773dcc6177aa391eabcb8c6d0f140d3d9776cc47c56b385eec85b9
Contents?: true
Size: 445 Bytes
Versions: 13
Compression:
Stored size: 445 Bytes
Contents
module SpreeMultiDomain::LineItemConcerns extend ActiveSupport::Concern class ProductDoesNotBelongToStoreError < StandardError; end included do prepend(InstanceMethods) before_create :ensure_product_belongs_to_store end module InstanceMethods private def ensure_product_belongs_to_store raise ProductDoesNotBelongToStoreError if order.store.present? && !product.stores.include?(order.store) end end end
Version data entries
13 entries across 13 versions & 1 rubygems