aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMax Magorsch <arzano@gentoo.org>2020-02-20 23:14:24 +0100
committerMax Magorsch <arzano@gentoo.org>2020-02-20 23:14:24 +0100
commit26f1a40d9a10c988911f5a8e0ae1c4f9a156049f (patch)
tree582c49a0333e39939cc9a9f9fc842575c7dab589
parentAdd information about the committer (diff)
downloadpackages-5-26f1a40d9a10c988911f5a8e0ae1c4f9a156049f.tar.gz
packages-5-26f1a40d9a10c988911f5a8e0ae1c4f9a156049f.tar.bz2
packages-5-26f1a40d9a10c988911f5a8e0ae1c4f9a156049f.zip
Fix some searches ordered by 'date'
So far there was only one 'date' field in the ES commit index. However, in the last commit, author_date and committer_date have been introduced. A plain 'date' field doesn't exist anymore. That's why searches that are using 'date' to order the results have been adjusted to use 'commmitter_date' instead. Signed-off-by: Max Magorsch <arzano@gentoo.org>
-rw-r--r--app/helpers/packages_helper.rb2
-rw-r--r--app/views/feeds/packages.atom.builder2
2 files changed, 2 insertions, 2 deletions
diff --git a/app/helpers/packages_helper.rb b/app/helpers/packages_helper.rb
index 7187f7d..d9a258e 100644
--- a/app/helpers/packages_helper.rb
+++ b/app/helpers/packages_helper.rb
@@ -81,7 +81,7 @@ module PackagesHelper
# Tries to find a matching changelog entry for a change object
def matching_changelog_entry(change)
changelog = Rails.cache.fetch("changelog/#{cp_to_atom(change.category, change.package)}", expires_in: 10.minutes) do
- CommitRepository.find_sorted_by('packages', change.category + '/' + change.package, 'date', 'desc', 5)
+ CommitRepository.find_sorted_by('packages', change.category + '/' + change.package, 'committer_date', 'desc', 5)
end
changelog.each do |changelog_entry|
diff --git a/app/views/feeds/packages.atom.builder b/app/views/feeds/packages.atom.builder
index 776510c..e2c82f9 100644
--- a/app/views/feeds/packages.atom.builder
+++ b/app/views/feeds/packages.atom.builder
@@ -13,7 +13,7 @@ atom_feed(id: atom_id(@feed_type, @feed_id, 'feed')) do |feed|
all_packages.each do |package|
atom = package.atom
- commit = CommitRepository.find_sorted_by :packages, atom, :date, 'desc', 1
+ commit = CommitRepository.find_sorted_by :packages, atom, :committer_date, 'desc', 1
commit = commit.first
if package.nil?