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
diff options
context:
space:
mode:
authorTM Lee <tm89lee@gmail.com>2017-03-15 08:44:05 +0300
committerTM Lee <tm89lee@gmail.com>2017-03-16 04:08:00 +0300
commit333e39d4923b285dce21c65f2923f132c36f5bf7 (patch)
tree7ec5ba7d5f3c5419560bc89b347cfc8b420a2c6c /app/models/wiki_page.rb
parent8fddde5b9f97feaa0c62f8c4a3e5441d20989165 (diff)
[#28991] Wiki page edit button only appears on the current commit page
- Added method to check if the current Page version is the current latest version - Conditionally checks for current version when showing Edit button - Added feature specs for viewing project wiki page and expect edit button - Added Changelog
Diffstat (limited to 'app/models/wiki_page.rb')
-rw-r--r--app/models/wiki_page.rb6
1 files changed, 6 insertions, 0 deletions
diff --git a/app/models/wiki_page.rb b/app/models/wiki_page.rb
index 2caebb496db..465c4d903ac 100644
--- a/app/models/wiki_page.rb
+++ b/app/models/wiki_page.rb
@@ -149,6 +149,12 @@ class WikiPage
end
# Returns boolean True or False if this instance
+ # is the latest commit version of the page.
+ def latest?
+ !historical?
+ end
+
+ # Returns boolean True or False if this instance
# has been fully saved to disk or not.
def persisted?
@persisted == true