Docs added
This commit is contained in:
parent
04c5009b5d
commit
e864415a03
1 changed files with 6 additions and 0 deletions
|
|
@ -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|
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue