app/models/user.rb
# WARNING: Before you go and try to make notification_count and message_count use the same query and then filter
# the results to count each type, rcognize (!) that they each use their own :after clause.  So be careful.
Before you go and try to make notification_count and message_count use the same query and then filter
the results to count each type, rcognize (!) that they each use their own :after clause.  So be careful.
Before you go and try to make notification_count and message_count use the same query and then filter the results to count each type rcognize ( ! ) that they each use their own : after clause . So be careful .
def notification_count
    activity_log(news: true, filter: 'all',
      after: self.last_notification_at,
      skip_loading_instances: true,
      user: self).count
  end
def notification_count activity_log ( news : true , filter : 'all' , after : self . last_notification_at , skip_loading_instances : true , user : self ) . count end
WARNING: Before you go and try to make notification_count and message_count use the same query and then filter
the results to count each type, rcognize (!)
WARNING : Before you go and try to make notification_count and message_count use the same query and then filter the results to count each type rcognize ( ! )