Skip to content

Commit

Permalink
提出物の状態が未アサインの場合のみ、提出物の削除時に未アサイン件数のキャッシュを削除するようにした
Browse files Browse the repository at this point in the history
  • Loading branch information
AudioStakes committed Jan 18, 2022
1 parent cda9f2d commit a1b414c
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
4 changes: 4 additions & 0 deletions app/models/product.rb
Original file line number Diff line number Diff line change
Expand Up @@ -164,6 +164,10 @@ def other_checker_exists?(current_user_id)
checker_id.present? && checker_id.to_s != current_user_id
end

def unassigned?
checker_id.nil?
end

def checker_name
checker_id ? User.find(checker_id).login_name : nil
end
Expand Down
2 changes: 1 addition & 1 deletion app/models/product_callbacks.rb
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ def after_destroy(product)
delete_notification(product)

Cache.delete_unchecked_product_count
Cache.delete_unassigned_product_count
Cache.delete_unassigned_product_count if product.unassigned?
Cache.delete_self_assigned_no_replied_product_count(product.checker_id)
end

Expand Down

0 comments on commit a1b414c

Please sign in to comment.