Commit db03bfa86838020d5add006f8e7714d4a0823c32

Authored by Dmitriy Zaporozhets
1 parent 0a0cdc6c

Apply user project limit only for personal projects. We should not include group…

… projects for user limit
app/models/user.rb
... ... @@ -294,12 +294,12 @@ class User < ActiveRecord::Base
294 294 end
295 295  
296 296 def projects_limit_left
297   - projects_limit - owned_projects.count
  297 + projects_limit - personal_projects.count
298 298 end
299 299  
300 300 def projects_limit_percent
301 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 303 end
304 304  
305 305 def recent_push project_id = nil
... ...
app/views/profiles/show.html.haml
... ... @@ -70,9 +70,9 @@
70 70 - unless current_user.projects_limit_left > 100
71 71 %fieldset
72 72 %legend
73   - Owned projects:
  73 + Personal projects:
74 74 %small.pull-right
75   - %span= current_user.owned_projects.count
  75 + %span= current_user.personal_projects.count
76 76 of
77 77 %span= current_user.projects_limit
78 78 .padded
... ...