mirror of
https://github.com/scinote-eln/scinote-web.git
synced 2025-03-07 13:13:10 +08:00
15 lines
355 B
Ruby
15 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
|