mirror of
https://github.com/wahyd4/gitlabhq.git
synced 2026-08-20 10:06:04 +10:00
Include snippet author in recipients of snippet note notification.
This commit is contained in:
@@ -87,6 +87,18 @@ class Snippet < ActiveRecord::Base
|
||||
visibility_level
|
||||
end
|
||||
|
||||
def participants(current_user = self.author)
|
||||
users = []
|
||||
users << author
|
||||
|
||||
notes.each do |note|
|
||||
users << note.author
|
||||
mentions << note.mentioned_users(current_user)
|
||||
end
|
||||
|
||||
users.concat(mentions.reduce([], :|)).uniq
|
||||
end
|
||||
|
||||
class << self
|
||||
def search(query)
|
||||
where('(title LIKE :query OR file_name LIKE :query)', query: "%#{query}%")
|
||||
|
||||
Reference in New Issue
Block a user