summaryrefslogtreecommitdiff
path: root/app/models/wiki_page.rb
diff options
context:
space:
mode:
authorDongqing Hu <sorra@outlook.com>2017-03-20 13:53:23 +0000
committerRémy Coutable <remy@rymai.me>2017-03-20 13:53:23 +0000
commit2dd9b8a38ad545c98355115589a9060b93de0b03 (patch)
tree2f87f6d4a2b120696c24a74a46551859e865bdf4 /app/models/wiki_page.rb
parent915af2dc5ae903d0007f5c2c75518483e00ab610 (diff)
downloadgitlab-ce-2dd9b8a38ad545c98355115589a9060b93de0b03.tar.gz
Fix Project Wiki update
Diffstat (limited to 'app/models/wiki_page.rb')
-rw-r--r--app/models/wiki_page.rb8
1 files changed, 5 insertions, 3 deletions
diff --git a/app/models/wiki_page.rb b/app/models/wiki_page.rb
index 465c4d903ac..c771c22f46a 100644
--- a/app/models/wiki_page.rb
+++ b/app/models/wiki_page.rb
@@ -155,7 +155,7 @@ class WikiPage
end
# Returns boolean True or False if this instance
- # has been fully saved to disk or not.
+ # has been fully created on disk or not.
def persisted?
@persisted == true
end
@@ -226,6 +226,8 @@ class WikiPage
end
def save(method, *args)
+ saved = false
+
project_wiki = wiki
if valid? && project_wiki.send(method, *args)
@@ -243,10 +245,10 @@ class WikiPage
set_attributes
@persisted = true
+ saved = true
else
errors.add(:base, project_wiki.error_message) if project_wiki.error_message
- @persisted = false
end
- @persisted
+ saved
end
end