From e26e23b4392105ff557799f89b900d54841250d5 Mon Sep 17 00:00:00 2001 From: Kyle Drake Date: Wed, 30 Oct 2019 13:58:38 -0700 Subject: [PATCH] order follows --- models/site.rb | 6 +++++- views/_follows.erb | 2 +- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/models/site.rb b/models/site.rb index 9a7068ea..62223004 100644 --- a/models/site.rb +++ b/models/site.rb @@ -534,7 +534,11 @@ class Site < Sequel::Model # Who this site is following def follows_dataset - super.select_all(:follows).inner_join(:sites, :id=>:actioning_site_id).exclude(:sites__is_deleted => true).exclude(:sites__is_banned => true) + super.select_all(:follows).inner_join(:sites, :id=>:actioning_site_id).exclude(:sites__is_deleted => true).order(:follow_count.desc,:views.desc,:updated_at.desc) + end + + def profile_follows_actioning_ids + follows_dataset.select(:actioning_site_id).exclude(:sites__site_changed => false).all end =begin diff --git a/views/_follows.erb b/views/_follows.erb index 920cb5cc..d9e1a6aa 100644 --- a/views/_follows.erb +++ b/views/_follows.erb @@ -19,7 +19,7 @@ <% if site_follows.empty? %> No followers yet. <% else %> - <% site.follows_dataset.select(:actioning_site_id).all.each do |follow| %> + <% site.profile_follows_actioning_ids.each do |follow| %> <% follow_actioning_site = follow.actioning_site_dataset.select(:username).first %> <% end %>