Hide implementation detail of reading
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
class Notifications::ReadingsController < ApplicationController
|
||||
def create
|
||||
@notification = Current.user.notifications.find(params[:id])
|
||||
@notification.update!(read_at: Time.current)
|
||||
@notification.read
|
||||
end
|
||||
|
||||
def create_all
|
||||
|
||||
@@ -15,6 +15,10 @@ class Notification < ApplicationRecord
|
||||
update!(read_at: Time.current)
|
||||
end
|
||||
|
||||
def read
|
||||
update!(read_at: Time.current)
|
||||
end
|
||||
|
||||
def read?
|
||||
read_at.present?
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user