Module: Mumuki::Laboratory::Controllers::Notifications
- Included in:
- ApplicationController
- Defined in:
- lib/mumuki/laboratory/controllers/notifications.rb
Instance Method Summary collapse
Instance Method Details
#has_notifications? ⇒ Boolean
2 3 4 |
# File 'lib/mumuki/laboratory/controllers/notifications.rb', line 2 def has_notifications? notifications_count > 0 end |
#notifications_count ⇒ Object
6 7 8 |
# File 'lib/mumuki/laboratory/controllers/notifications.rb', line 6 def notifications_count user_notifications.size end |
#user_notifications ⇒ Object
10 11 12 |
# File 'lib/mumuki/laboratory/controllers/notifications.rb', line 10 def user_notifications current_user.try(:unread_notifications) || [] end |