diff options
author | Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com> | 2013-11-05 16:41:29 +0200 |
---|---|---|
committer | Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com> | 2013-11-05 16:41:29 +0200 |
commit | d78b6ce4cc01ac5da52246c149f57de456b904ae (patch) | |
tree | 3f55226230ff46d27485578999179f8cd801f05e /app/models/user.rb | |
parent | f9b66aecddb248dcd501419e0ee94fd69fab4de3 (diff) | |
download | gitlab-ce-d78b6ce4cc01ac5da52246c149f57de456b904ae.tar.gz |
New feature: Ability to leave project
Signed-off-by: Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
Diffstat (limited to 'app/models/user.rb')
-rw-r--r-- | app/models/user.rb | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/app/models/user.rb b/app/models/user.rb index df14cf34e85..7ef3b3f9e1a 100644 --- a/app/models/user.rb +++ b/app/models/user.rb @@ -394,4 +394,9 @@ class User < ActiveRecord::Base self end + + def can_leave_project?(project) + project.namespace != namespace && + project.project_member(self) + end end |