mirror of
https://github.com/scinote-eln/scinote-web.git
synced 2025-03-09 06:04:46 +08:00
16 lines
355 B
Ruby
16 lines
355 B
Ruby
|
# frozen_string_literal: true
|
||
|
|
||
|
module Assignable
|
||
|
extend ActiveSupport::Concern
|
||
|
|
||
|
included do
|
||
|
has_many :user_assignments, as: :assignable, dependent: :destroy
|
||
|
|
||
|
default_scope { includes(user_assignments: :user_role) }
|
||
|
|
||
|
after_create_commit do
|
||
|
UserAssignments::GenerateUserAssignmentsJob.perform_later(self, created_by)
|
||
|
end
|
||
|
end
|
||
|
end
|