summaryrefslogtreecommitdiff
path: root/app/models/wiki_page.rb
diff options
context:
space:
mode:
authorFrancisco Javier López <fjlopez@gitlab.com>2018-04-18 17:50:56 +0000
committerDouwe Maan <douwe@gitlab.com>2018-04-18 17:50:56 +0000
commite8a27a67fadfa8e62d1c72979281bcd74c39c489 (patch)
tree0bb3612890dcce48600c9f88352daaf1cb8b73a2 /app/models/wiki_page.rb
parent6a5de6dd3bc122be0473d80ba213de71be6b0fe8 (diff)
downloadgitlab-ce-e8a27a67fadfa8e62d1c72979281bcd74c39c489.tar.gz
Fix Custom hooks are not triggered by UI wiki edit
Diffstat (limited to 'app/models/wiki_page.rb')
-rw-r--r--app/models/wiki_page.rb18
1 files changed, 9 insertions, 9 deletions
diff --git a/app/models/wiki_page.rb b/app/models/wiki_page.rb
index 0f5536415f7..cde79b95062 100644
--- a/app/models/wiki_page.rb
+++ b/app/models/wiki_page.rb
@@ -265,6 +265,15 @@ class WikiPage
title.present? && self.class.unhyphenize(@page.url_path) != title
end
+ # Updates the current @attributes hash by merging a hash of params
+ def update_attributes(attrs)
+ attrs[:title] = process_title(attrs[:title]) if attrs[:title].present?
+
+ attrs.slice!(:content, :format, :message, :title)
+
+ @attributes.merge!(attrs)
+ end
+
private
# Process and format the title based on the user input.
@@ -290,15 +299,6 @@ class WikiPage
File.join(components)
end
- # Updates the current @attributes hash by merging a hash of params
- def update_attributes(attrs)
- attrs[:title] = process_title(attrs[:title]) if attrs[:title].present?
-
- attrs.slice!(:content, :format, :message, :title)
-
- @attributes.merge!(attrs)
- end
-
def set_attributes
attributes[:slug] = @page.url_path
attributes[:title] = @page.title