diff options
author | ThibG <thib@sitedethib.com> | 2019-03-28 15:12:33 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-03-28 15:12:33 +0100 |
commit | bb316faffff7a76bc89f7e942233f0e14caf60f5 (patch) | |
tree | 260458c7ff43dd82fc02cc7e5ef0920dd8d2a25b /app/controllers | |
parent | 0418bdd71f59b4d7e9f3498f2990c8b044f310e1 (diff) | |
parent | 050efbc12650feaac3e833c4dd740bf090e3dae1 (diff) |
Merge pull request #970 from ThibG/glitch-soc/merge-upstream
Merge upstream changes
Diffstat (limited to 'app/controllers')
-rw-r--r-- | app/controllers/relationships_controller.rb | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/app/controllers/relationships_controller.rb b/app/controllers/relationships_controller.rb index a0b9c77df..c87a0cf13 100644 --- a/app/controllers/relationships_controller.rb +++ b/app/controllers/relationships_controller.rb @@ -32,13 +32,14 @@ class RelationshipsController < ApplicationController def relationships_scope scope = begin if following_relationship? - current_account.following.joins(:account_stat) + current_account.following.eager_load(:account_stat).reorder(nil) else - current_account.followers.joins(:account_stat) + current_account.followers.eager_load(:account_stat).reorder(nil) end end - scope.merge!(Follow.recent) + scope.merge!(Follow.recent) if params[:order].blank? || params[:order] == 'recent' + scope.merge!(Account.by_recent_status) if params[:order] == 'active' scope.merge!(mutual_relationship_scope) if mutual_relationship? scope.merge!(moved_account_scope) if params[:status] == 'moved' scope.merge!(primary_account_scope) if params[:status] == 'primary' @@ -85,7 +86,7 @@ class RelationshipsController < ApplicationController end def current_params - params.slice(:page, :status, :relationship, :by_domain, :activity).permit(:page, :status, :relationship, :by_domain, :activity) + params.slice(:page, :status, :relationship, :by_domain, :activity, :order).permit(:page, :status, :relationship, :by_domain, :activity, :order) end def action_from_button |