Skip to content

Commit

Permalink
Remove Notifications::RemoveAllByActionJob and Handle inline (#5690)
Browse files Browse the repository at this point in the history
  • Loading branch information
luchiago authored and mstruve committed Jan 28, 2020
1 parent 3b3d2be commit ca0770d
Show file tree
Hide file tree
Showing 3 changed files with 1 addition and 37 deletions.
11 changes: 0 additions & 11 deletions app/jobs/notifications/remove_all_by_action_job.rb

This file was deleted.

8 changes: 1 addition & 7 deletions app/models/notification.rb
Original file line number Diff line number Diff line change
Expand Up @@ -93,16 +93,10 @@ def send_milestone_notification(type:, article_id:)
Notifications::MilestoneWorker.perform_async(type, article_id)
end

def remove_all_by_action(notifiable_ids:, notifiable_type:, action: nil)
return unless %w[Article Comment Mention].include?(notifiable_type) && notifiable_ids.present?

Notifications::RemoveAllByActionJob.perform_later(notifiable_ids, notifiable_type, action)
end

def remove_all_by_action_without_delay(notifiable_ids:, notifiable_type:, action: nil)
return unless %w[Article Comment Mention].include?(notifiable_type) && notifiable_ids.present?

Notifications::RemoveAllByActionJob.perform_now(notifiable_ids, notifiable_type, action)
Notifications::RemoveAllByAction.call(Array.wrap(notifiable_ids), notifiable_type, action)
end

def remove_all(notifiable_ids:, notifiable_type:)
Expand Down
19 changes: 0 additions & 19 deletions spec/jobs/notifications/remove_all_by_action_job_spec.rb

This file was deleted.

0 comments on commit ca0770d

Please sign in to comment.