Sha256: f95ae19d07b1b0cb5aca56f9d71f8b650c58f8779c9ec75904e3bedff8ce92a6
Contents?: true
Size: 447 Bytes
Versions: 32
Compression:
Stored size: 447 Bytes
Contents
module Spree module SingleStoreResource extend ActiveSupport::Concern included do validate :ensure_store_association_is_not_changed scope :for_store, ->(store) { where(store_id: store.id) } end protected def ensure_store_association_is_not_changed if store_id_changed? && persisted? errors.add(:store, Spree.t('errors.messages.store_association_can_not_be_changed')) end end end end
Version data entries
32 entries across 32 versions & 1 rubygems