Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKamil Trzcinski <ayufan@ayufan.eu>2016-06-15 13:12:26 +0300
committerKamil Trzcinski <ayufan@ayufan.eu>2016-06-15 13:12:26 +0300
commit18fd2ccb8b9b60e2acd6782a4160f85d3ee6c95f (patch)
tree1637aa45423d2a3c13c0a531acfda39f0aecf743
parent00526440092bb82beb86b87376dd1ea6178bf05f (diff)
Improve cyclomatic of ability::allowed
-rw-r--r--app/models/ability.rb16
1 files changed, 1 insertions, 15 deletions
diff --git a/app/models/ability.rb b/app/models/ability.rb
index 734b152605b..8d76e8efa13 100644
--- a/app/models/ability.rb
+++ b/app/models/ability.rb
@@ -9,7 +9,6 @@ class Ability
when CommitStatus then commit_status_abilities(user, subject)
when Project then project_abilities(user, subject)
when Issue then issue_abilities(user, subject)
- when ExternalIssue then external_issue_abilities(user, subject)
when Note then note_abilities(user, subject)
when ProjectSnippet then project_snippet_abilities(user, subject)
when PersonalSnippet then personal_snippet_abilities(user, subject)
@@ -18,9 +17,8 @@ class Ability
when Namespace then namespace_abilities(user, subject)
when GroupMember then group_member_abilities(user, subject)
when ProjectMember then project_member_abilities(user, subject)
- when Deployment then deployment_abilities(user, subject)
- when Environment then environment_abilities(user, subject)
when User then user_abilities
+ when ExternalIssue, Deployment, Environment then project_abilities(user, subject.project)
else []
end.concat(global_abilities(user))
end
@@ -523,18 +521,6 @@ class Ability
end
end
- def external_issue_abilities(user, subject)
- project_abilities(user, subject.project)
- end
-
- def deployment_abilities(user, subject)
- project_abilities(user, subject.project)
- end
-
- def environment_abilities(user, subject)
- project_abilities(user, subject.project)
- end
-
private
def restricted_public_level?