adds counter cache for user's notifications

This commit is contained in:
Juanjo Bazán
2016-01-08 14:39:34 +01:00
parent 704a038795
commit 432e9e0d5b
4 changed files with 10 additions and 4 deletions

View File

@@ -1,5 +1,5 @@
class Notification < ActiveRecord::Base
belongs_to :user
belongs_to :user, counter_cache: true
belongs_to :notifiable, polymorphic: true
scope :unread, -> { all }