summaryrefslogtreecommitdiffstats
path: root/app/models
diff options
context:
space:
mode:
authorMarius Balteanu <marius.balteanu@zitec.com>2022-02-20 15:51:38 +0000
committerMarius Balteanu <marius.balteanu@zitec.com>2022-02-20 15:51:38 +0000
commit022d9a1254c4c7dfd043e1f56d7b4afc52baad3b (patch)
tree79f1bfcc19fdf3fb6d1709a0a07e5e70d1a41d6c /app/models
parenta4ce5024d59f404fc7497f39aaf44b1e52531b84 (diff)
downloadredmine-022d9a1254c4c7dfd043e1f56d7b4afc52baad3b.tar.gz
redmine-022d9a1254c4c7dfd043e1f56d7b4afc52baad3b.zip
Merged r21413 to 4.1-stable (#36561).
git-svn-id: http://svn.redmine.org/redmine/branches/4.1-stable@21419 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'app/models')
-rw-r--r--app/models/wiki_page.rb6
1 files changed, 1 insertions, 5 deletions
diff --git a/app/models/wiki_page.rb b/app/models/wiki_page.rb
index c4da80ff9..e1765a20d 100644
--- a/app/models/wiki_page.rb
+++ b/app/models/wiki_page.rb
@@ -155,11 +155,7 @@ class WikiPage < ActiveRecord::Base
end
def content_for_version(version=nil)
- if content
- result = content.versions.find_by_version(version.to_i) if version
- result ||= content
- result
- end
+ (content && version) ? content.versions.find_by_version(version.to_i) : content
end
def diff(version_to=nil, version_from=nil)