rails-engine / notifications

Compare 1cb0996 ... +3 ... ba31caa

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

Learn more about Codecov Flags here.


@@ -38,9 +38,9 @@
Loading
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,11 +4,16 @@
Loading
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

@@ -0,0 +1,12 @@
Loading
1 +
module Notifications
2 +
  class Base
3 +
    extend ActiveSupport::Concern
4 +
5 +
    included do
6 +
    end
7 +
8 +
    class_methods do
9 +
      def
10 +
    end
11 +
  end
12 +
end

Learn more Showing 1 files with coverage changes found.

New file lib/notifications/base.rb
New
Loading file...
Files Coverage
app +1.04% 90.32%
lib -13.70% 86.30%
Project Totals (8 files) 87.50%
Loading