diff options
author | Lin Jen-Shin <godfat@godfat.org> | 2018-07-13 12:34:27 +0300 |
---|---|---|
committer | Lin Jen-Shin <godfat@godfat.org> | 2018-07-13 12:34:27 +0300 |
commit | d9f26586b4ec00c00fb470e55af3dc5c1f4ce33a (patch) | |
tree | 1a16bb35e6b103042ed405dcb37227c4dc44244f /app/models/project_wiki.rb | |
parent | 99c80156ae6058f70fde77baabd5f007f0246e6d (diff) | |
parent | a3c8525dc9a69d0e1048c114fd27317dcffc4221 (diff) |
Merge remote-tracking branch 'upstream/master' into 14995-custom_wiki_sidebar
* upstream/master: (467 commits)
Update docs board features tier
Upgrade grape-path-helpers to 1.0.6
Remove healthchecks from prometheus endpoint
Fix find_branch call sites
Ensure Encoding.default_external is set to UTF-8 when running QA scenarios
i18n: externalize strings from 'app/views/admin/groups'
Backport mr widget changes from EE
Allow to toggle notifications for issues due soon
Vuex test helper improvements
whitespace
Make more ref RPC's mandatory
Resolve "Improve performance of MR Changes tab: reduce event listeners on scroll event"
Remove old service architecture from Vue docs
Adding spec to test basic forking functionalities
Fix performance problem of accessing tag list for projects api endpoints
typo
Add sleep to QA test before installing tiller
Include Vue files that are not covered by tests in test coverage
Remove Repository#path memoization
Resolve "do not set updated_at when creating note"
...
Diffstat (limited to 'app/models/project_wiki.rb')
-rw-r--r-- | app/models/project_wiki.rb | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/app/models/project_wiki.rb b/app/models/project_wiki.rb index 05b07804ea8..3aa56b3983f 100644 --- a/app/models/project_wiki.rb +++ b/app/models/project_wiki.rb @@ -23,7 +23,6 @@ class ProjectWiki @user = user end - delegate :empty?, to: :pages delegate :repository_storage, :hashed_storage?, to: :project def path @@ -77,6 +76,10 @@ class ProjectWiki !!find_page('home') end + def empty? + pages(limit: 1).empty? + end + # Returns an Array of Gitlab WikiPage instances or an # empty Array if this Wiki has no pages. def pages(limit: nil) @@ -114,7 +117,7 @@ class ProjectWiki update_project_activity rescue Gitlab::Git::Wiki::DuplicatePageError => e @error_message = "Duplicate page: #{e.message}" - return false + false end def update_page(page, content:, title: nil, format: :markdown, message: nil) |