Docs added

This commit is contained in:
Christoph Haas 2016-06-27 15:59:51 +02:00
parent 04c5009b5d
commit e864415a03

View file

@ -53,6 +53,12 @@ class Package < ActiveRecord::Base
end
# Return the newest screenshot that is not newer than the given version.
# This algorithm collects all image
# versions of a package and determines the (second) newest version.
# E.g. if there are version 1.0 and 2.0 and the user is looking for
# a screenshot of version 1.5 then the 1.0 version is returned.
# This way the user does not see a screenshot of version 2.0 because
# 2.0 might contain features that were not there in version 1.5.
def best_screenshot_for_version(version)
sorted_screenshots = self.screenshots_sorted_by_version
sorted_screenshots.each do |ss|