Skip to content

Commit

Permalink
rubocopによる修正
Browse files Browse the repository at this point in the history
  • Loading branch information
Daichi831 committed Aug 17, 2021
1 parent ec1f951 commit 2512731
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions app/models/comment_callbacks.rb
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ def after_update(comment)

def after_destroy(comment)
return unless comment.commentable.instance_of?(Product)

delete_last_comment_at(comment.commentable.id)
delete_product_cache(comment.commentable.id)
end
Expand All @@ -31,10 +32,10 @@ def after_destroy(comment)

def delete_last_comment_at(product_id)
product = Product.find(product_id)
#最終日時をリセットする
# 最終日時をリセットする
product.mentor_last_comment_at = nil
product.self_last_comment_at = nil
#最新日時を上書きする
# 最新日時を上書きする
product.comments.each do |comment|
if comment.user.mentor
product.mentor_last_comment_at = comment.updated_at
Expand Down

0 comments on commit 2512731

Please sign in to comment.