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
path: root/app
diff options
context:
space:
mode:
authorDouwe Maan <douwe@gitlab.com>2016-08-30 17:49:36 +0300
committerRuben Davila <rdavila84@gmail.com>2016-08-31 17:42:42 +0300
commita33199f3f8fa5b6303346d556fd2d1ec970413f0 (patch)
treee1c5b105a85ca35b510dac37b39456b9f4ce3ea9 /app
parent99ae4c0d15cf9c01f2ccbd1c984f5e86da2d952b (diff)
Merge branch '21446-service-external-wiki-only-works-when-project-wiki-is-enabled' into 'master'
Fix "Wiki" link not appearing in navigation for projects with external wiki ## Are there points in the code the reviewer needs to double check? No ## What are the relevant issue numbers? Closes #21446 ## Does this MR meet the acceptance criteria? - [x] [CHANGELOG](https://gitlab.com/gitlab-org/gitlab-ce/blob/master/CHANGELOG) entry added - [ ] [Documentation created/updated](https://gitlab.com/gitlab-org/gitlab-ce/blob/master/doc/development/doc_styleguide.md) - [ ] API support added - Tests - [x] Added for this feature/bug - [ ] All builds are passing - [x] Conform by the [style guides](https://gitlab.com/gitlab-org/gitlab-ce/blob/master/CONTRIBUTING.md#style-guides) - [ ] Branch has no merge conflicts with `master` (if you do - rebase it please) - [x] [Squashed related commits together](https://git-scm.com/book/en/Git-Tools-Rewriting-History#Squashing-Commits) See merge request !6057
Diffstat (limited to 'app')
-rw-r--r--app/models/ability.rb2
-rw-r--r--app/models/project.rb4
2 files changed, 5 insertions, 1 deletions
diff --git a/app/models/ability.rb b/app/models/ability.rb
index a49dd703926..c1df4a865f6 100644
--- a/app/models/ability.rb
+++ b/app/models/ability.rb
@@ -355,7 +355,7 @@ class Ability
rules += named_abilities('project_snippet')
end
- unless project.wiki_enabled
+ unless project.has_wiki?
rules += named_abilities('wiki')
end
diff --git a/app/models/project.rb b/app/models/project.rb
index 8cf093be4c3..edf536e2f98 100644
--- a/app/models/project.rb
+++ b/app/models/project.rb
@@ -680,6 +680,10 @@ class Project < ActiveRecord::Base
update_column(:has_external_issue_tracker, services.external_issue_trackers.any?)
end
+ def has_wiki?
+ wiki_enabled? || has_external_wiki?
+ end
+
def external_wiki
if has_external_wiki.nil?
cache_has_external_wiki # Populate