Commit db03bfa86838020d5add006f8e7714d4a0823c32
1 parent
0a0cdc6c
Exists in
master
and in
4 other branches
Apply user project limit only for personal projects. We should not include group…
… projects for user limit
Showing
2 changed files
with
4 additions
and
4 deletions
Show diff stats
app/models/user.rb
@@ -294,12 +294,12 @@ class User < ActiveRecord::Base | @@ -294,12 +294,12 @@ class User < ActiveRecord::Base | ||
294 | end | 294 | end |
295 | 295 | ||
296 | def projects_limit_left | 296 | def projects_limit_left |
297 | - projects_limit - owned_projects.count | 297 | + projects_limit - personal_projects.count |
298 | end | 298 | end |
299 | 299 | ||
300 | def projects_limit_percent | 300 | def projects_limit_percent |
301 | return 100 if projects_limit.zero? | 301 | return 100 if projects_limit.zero? |
302 | - (owned_projects.count.to_f / projects_limit) * 100 | 302 | + (personal_projects.count.to_f / projects_limit) * 100 |
303 | end | 303 | end |
304 | 304 | ||
305 | def recent_push project_id = nil | 305 | def recent_push project_id = nil |
app/views/profiles/show.html.haml
@@ -70,9 +70,9 @@ | @@ -70,9 +70,9 @@ | ||
70 | - unless current_user.projects_limit_left > 100 | 70 | - unless current_user.projects_limit_left > 100 |
71 | %fieldset | 71 | %fieldset |
72 | %legend | 72 | %legend |
73 | - Owned projects: | 73 | + Personal projects: |
74 | %small.pull-right | 74 | %small.pull-right |
75 | - %span= current_user.owned_projects.count | 75 | + %span= current_user.personal_projects.count |
76 | of | 76 | of |
77 | %span= current_user.projects_limit | 77 | %span= current_user.projects_limit |
78 | .padded | 78 | .padded |