Do not show version in image caption

This commit is contained in:
Christoph Haas 2016-06-22 18:10:23 +02:00
parent f2552736dc
commit 2d73e7a1b4

View file

@ -46,10 +46,10 @@ class Screenshot < ActiveRecord::Base
# Takes the description of a screenshot if available.
# Otherwise it falls back to the general description of its package.
def caption
if self.description != ''
"#{self.description} Version #{self.version}"
if self.description.present?
"#{self.description}"
else
"#{self.package.description} Version #{self.version}"
"#{self.package.description}"
end
end