Cleanup Lint/AssignmentInCondition rubocop issues on code and remove it from ruboco_todo list
This commit is contained in:
@@ -17,7 +17,9 @@ class Notification < ActiveRecord::Base
|
||||
end
|
||||
|
||||
def self.add(user_id, notifiable)
|
||||
if notification = Notification.find_by(user_id: user_id, notifiable: notifiable)
|
||||
notification = Notification.find_by(user_id: user_id, notifiable: notifiable)
|
||||
|
||||
if notification.present?
|
||||
Notification.increment_counter(:counter, notification.id)
|
||||
else
|
||||
Notification.create!(user_id: user_id, notifiable: notifiable)
|
||||
@@ -50,4 +52,4 @@ class Notification < ActiveRecord::Base
|
||||
notifiable.is_a?(ProposalNotification) ? notifiable.proposal : notifiable
|
||||
end
|
||||
|
||||
end
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user