No flags found
Use flags to group coverage reports by test type, project and/or folders.
Then setup custom commit statuses and notifications for each flag.
e.g., #unittest #integration
#production #enterprise
#frontend #backend
1cb0996
... +3 ...
ba31caa
Use flags to group coverage reports by test type, project and/or folders.
Then setup custom commit statuses and notifications for each flag.
e.g., #unittest #integration
#production #enterprise
#frontend #backend
38 | 38 | end |
|
39 | 39 | ||
40 | 40 | module ClassMethods |
|
41 | - | def read!(ids = []) |
|
41 | + | def read!(user, ids = []) |
|
42 | 42 | return if ids.blank? |
|
43 | - | Notification.where(id: ids).update_all(read_at: Time.now) |
|
43 | + | Notification.where(user: user, id: ids).update_all(read_at: Time.now) |
|
44 | 44 | end |
|
45 | 45 | ||
46 | 46 | def unread_count(user) |
4 | 4 | @notifications = notifications.includes(:actor).order("id desc").page(params[:page]) |
|
5 | 5 | ||
6 | 6 | unread_ids = @notifications.reject(&:read?).select(&:id) |
|
7 | - | Notification.read!(unread_ids) |
|
7 | + | Notification.read!(current_user, unread_ids) |
|
8 | 8 | ||
9 | 9 | @notification_groups = @notifications.group_by { |note| note.created_at.to_date } |
|
10 | 10 | end |
|
11 | 11 | ||
12 | + | def read |
|
13 | + | Notification.read!(current_user, params[:ids]) |
|
14 | + | render json: { ok: 1 } |
|
15 | + | end |
|
16 | + | ||
12 | 17 | def clean |
|
13 | 18 | notifications.delete_all |
|
14 | 19 | redirect_to notifications_path |
Learn more Showing 1 files with coverage changes found.
lib/notifications/base.rb
ba31caa
3c253eb
23f820e
3162b19
1cb0996