aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlec Warner <antarus@gentoo.org>2018-02-25 19:52:00 -0500
committerAlec Warner <antarus@gentoo.org>2018-02-25 19:52:00 -0500
commit65e1fb72f583e3f3e2ce00bc78ae4d5c6ed45fc6 (patch)
treefa446f77a59791266ee69050d733a7856b66032a
parentMark bin/first-run as executable. (diff)
downloadpackages-65e1fb72f583e3f3e2ce00bc78ae4d5c6ed45fc6.tar.gz
packages-65e1fb72f583e3f3e2ce00bc78ae4d5c6ed45fc6.tar.bz2
packages-65e1fb72f583e3f3e2ce00bc78ae4d5c6ed45fc6.zip
Uniqify versions in the UI for the moment.v6.0.4
The indexer is still doing naughty things, but we can patch the UI to uniqify versions until we fix the index.
-rw-r--r--app/models/package.rb5
1 files changed, 4 insertions, 1 deletions
diff --git a/app/models/package.rb b/app/models/package.rb
index 7ad3cbe..ea7d871 100644
--- a/app/models/package.rb
+++ b/app/models/package.rb
@@ -47,13 +47,16 @@ class Package
@versions ||= Version.find_all_by(:package, atom, sort: { sort_key: { order: 'asc' } })
end
+ def unique_versions
+ versions.uniq { |v| v.version }
+ end
+
def latest_version
versions.first
end
def version(version_str)
versions.each { |version| return version if version.version == version_str }
-
nil
end