Sha256: 76e0bac3c1c03317108b0ead78c0f4734313d63b0a757d3bd28185a3ab945c42
Contents?: true
Size: 579 Bytes
Versions: 51
Compression:
Stored size: 579 Bytes
Contents
require 'subj_models/concerns/comprising_external_id' module SubjModels module NomenclatureVarietyModule def self.included(including_class) including_class.class_eval do include SubjModels::ComprisingExternalId belongs_to :nomenclature has_many :nomenclature_prices has_many :order_items validates :name, presence: true scope :external_id, -> id { where(external_id: id) } scope :nomenclature_id, -> (nomenclature_id) { parent_id_scope("nomenclature", nomenclature_id) } end end end end
Version data entries
51 entries across 51 versions & 2 rubygems