Sha256: a2a374fc2c8e031b5bde7d0a93d6bc4f50fd35122117b004dee1123992a0c865

Contents?: true

Size: 621 Bytes

Versions: 2

Compression:

Stored size: 621 Bytes

Contents

require 'subj_models/concerns/comprising_external_id'

module SubjModels

  module SpecialistActivity

    def self.included(including_class)

      including_class.class_eval do

        include SubjModels::ComprisingExternalId

        has_many :specialist_activity_document_types, dependent: :destroy
        has_many :user_specialization_approvals, dependent: :destroy
        has_many :nomenclatures

        belongs_to :document_file

        validates :name, presence: true

        scope :unavailable_for_current_user, -> ids { where.not(id: ids) }

      end

    end

    def to_s
      name
    end

  end

end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
subj_models-0.4.1 lib/subj_models/specialist_activity.rb
subj_models-0.4 lib/subj_models/specialist_activity.rb