7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
|
# File 'lib/subj_models/user_specialization.rb', line 7
def self.included(including_class)
including_class.class_eval do
include SubjModels::ComprisingExternalId
has_and_belongs_to_many :users
has_and_belongs_to_many :access_groups
has_and_belongs_to_many :events
has_and_belongs_to_many :user_videos
has_many :specialist_activity_document_types, dependent: :destroy
has_many :user_specialization_approvals, dependent: :destroy
has_many :nomenclatures
validates :name, presence: true
scope :user_id, -> (user_id) { parent_id_scope("user", user_id) }
scope :unavailable_for_current_user, -> ids { where.not(id: ids) }
end
def to_s
name.to_s
end
end
|