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
committerDouwe Maan <douwe@gitlab.com>2016-08-30 17:49:36 +0300
commit924fdf4a841731e9ff74eb3da15290b7745da029 (patch)
treecaee77481de7c8e961ec455d69d3ee6c01f65329 /app
parent81910022044a3a5b4c6ee6c913e2bee0879937c6 (diff)
parent6686084c6502f10fd7e6b8963ab52526cb6831bf (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 0e4fb94f8eb..0fa41ebbec3 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