Commit 7633d602 authored by Douwe Maan's avatar Douwe Maan

Include snippet author in recipients of snippet note notification.

parent 959ebbca
...@@ -87,6 +87,18 @@ class Snippet < ActiveRecord::Base ...@@ -87,6 +87,18 @@ class Snippet < ActiveRecord::Base
visibility_level visibility_level
end 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 class << self
def search(query) def search(query)
where('(title LIKE :query OR file_name LIKE :query)', query: "%#{query}%") where('(title LIKE :query OR file_name LIKE :query)', query: "%#{query}%")
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment