gitlab-org--gitlab-foss/app/models/issue_assignee.rb
2017-05-04 20:00:33 +03:00

13 lines
333 B
Ruby

class IssueAssignee < ActiveRecord::Base
extend Gitlab::CurrentSettings
belongs_to :issue
belongs_to :assignee, class_name: "User", foreign_key: :user_id
after_create :update_assignee_cache_counts
after_destroy :update_assignee_cache_counts
def update_assignee_cache_counts
assignee&.update_cache_counts
end
end