<% notifications = 0 %> <% if user_signed_in? %> <% unless current_user.user_notifications.where(read: false).empty? %> <% notifications = current_user.user_notifications.where(read: false).count %> <% end %> <% end %>