Skip to content

Commit

Permalink
ブログ初回公開のみ通知するよう条件分岐を修正
Browse files Browse the repository at this point in the history
  • Loading branch information
motohiro-mm committed Jul 1, 2024
1 parent 88aae17 commit 43c83f8
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion app/models/article_notifier.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
class ArticleNotifier
def call(payload)
article = payload[:article]
return if article.wip?
return unless article.saved_change_to_attribute?(:published_at, from: nil)

receivers = User.students_trainees_mentors_and_admins.reject { |receiver| receiver == article.user }
send_notification(article:, receivers:)
Expand Down

0 comments on commit 43c83f8

Please sign in to comment.