diff --git a/app/helpers/user_score_helper.rb b/app/helpers/user_score_helper.rb index 43ee05db8..d9ab8730a 100644 --- a/app/helpers/user_score_helper.rb +++ b/app/helpers/user_score_helper.rb @@ -297,6 +297,14 @@ module UserScoreHelper return (commit_count + issue_details_count) end + + + def calculate_attachments(user) + attachments = Attachment.where("container_type IS NOT NULL AND container_type <> 'Issue' AND author_id = ?", user.id).count + + return attachments + + end def calculate_user_score(user) collaboration = calculate_collaboration_count(user) diff --git a/app/views/test/index.html.erb b/app/views/test/index.html.erb index eeef0f3da..17c7089d1 100644 --- a/app/views/test/index.html.erb +++ b/app/views/test/index.html.erb @@ -4,13 +4,14 @@ <% users = User.all%>
name | C | I | S | filecount | issuecount | level | +id | name | C | I | S | filecount | issuecount | level | attachconut |
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
<%= user.id %> | <%= user.lastname %><%= user.firstname %> | <%= calculate_collaboration_count(user) %> | <%= calculate_influence_count(user) %> | @@ -18,6 +19,7 @@<%= calculate_file(user) %> | <%= calculate_issue(user) %> | <%= calculate_level(user) %> | +<%= calculate_attachments(user) %> |