Skip to content
Permalink
Browse files

Refactoring: Removed unnecessary OnlineNotification.seen method.

  • Loading branch information...
thorsteneckel committed Sep 5, 2019
1 parent 9c76def commit 0afb105dd779003b8865d22df72d5c2a1be4fe25
Showing with 3 additions and 19 deletions.
  1. +3 −3 app/controllers/online_notifications_controller.rb
  2. +0 −16 app/models/online_notification.rb
@@ -174,9 +174,9 @@ def destroy
def mark_all_as_read
notifications = OnlineNotification.list(current_user, 200)
notifications.each do |notification|
if !notification['seen']
OnlineNotification.seen(id: notification['id'])
end
next if notification['seen']

OnlineNotification.find(notification['id']).update!(seen: true)
end
render json: {}, status: :ok
end
@@ -61,22 +61,6 @@ def self.add(data)

=begin
mark online notification as seen
OnlineNotification.seen(
id: 2,
)
=end

def self.seen(data)
notification = OnlineNotification.find(data[:id])
notification.seen = true
notification.save
end

=begin
remove whole online notifications of an object
OnlineNotification.remove('Ticket', 123)

0 comments on commit 0afb105

Please sign in to comment.
You can’t perform that action at this time.