This commit is contained in:
Christoph Haas 2017-08-14 08:09:23 +02:00
parent 098afc1924
commit 193d44f89a
27 changed files with 331 additions and 707 deletions

View file

@ -82,6 +82,11 @@ class Package < ApplicationRecord
return sorted_screenshots.last
end
# Return the part of the version up to the first - or +
def upstream_version
self.version.split(/[\-\+]/).first
end
private
def version_compare(x,y)

View file

@ -116,7 +116,7 @@ class Screenshot < ApplicationRecord
# Publish a screenshot from the moderation queue
def approve_screenshot!
self.delete_reason = nil
self.markedfordelete = false
self.approved = true
@ -164,4 +164,9 @@ class Screenshot < ApplicationRecord
false
end
# Return the part of the version up to the first - or +
def upstream_version
self.version.split(/[\-\+]/).first
end
end