diff --git a/app/models/project.rb b/app/models/project.rb index 0ba2f943c..0baab5d64 100644 --- a/app/models/project.rb +++ b/app/models/project.rb @@ -189,4 +189,12 @@ class Project < ActiveRecord::Base .distinct end end + + def notifications_count(user) + res = 0 + assigned_modules(user).find_each do |t| + res += 1 if t.is_overdue? || t.is_one_day_prior? + end + res + end end diff --git a/app/views/projects/index/_project.html.erb b/app/views/projects/index/_project.html.erb index 29a39e8b9..e1bbf6045 100644 --- a/app/views/projects/index/_project.html.erb +++ b/app/views/projects/index/_project.html.erb @@ -75,6 +75,9 @@ data-project-users-tab-url="<%= url_for project_user_projects_path(project_id: p