Sha256: 60968b5a42e5316b6dc176977a6001d53c6d116d1fef49cab497c00a517bef15
Contents?: true
Size: 734 Bytes
Versions: 51
Compression:
Stored size: 734 Bytes
Contents
require 'subj_models/concerns/comprising_external_id' module SubjModels module NomenclatureReviewModule def self.included(including_class) including_class.class_eval do include SubjModels::ComprisingExternalId after_create :notify belongs_to :nomenclature belongs_to :user validates :user, :nomenclature, :content, presence: true scope :nomenclature_id, -> nomenclature { where(nomenclature_id: nomenclature) } scope :approved, -> { where(review_approved: true) } scope :without_approves, -> { where(review_approved: false) } end end private def notify NomenclatureReviewMailer.notify(self).deliver end end end
Version data entries
51 entries across 51 versions & 2 rubygems