Module: SubjModels::NomenclatureVarietyModule
- Defined in:
- lib/subj_models/nomenclature_variety.rb
Class Method Summary collapse
Class Method Details
.included(including_class) ⇒ Object
7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 |
# File 'lib/subj_models/nomenclature_variety.rb', line 7 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 |