Show cached_votes_score on admin legislation proposals

This commit is contained in:
decabeza
2019-02-08 18:38:49 +01:00
parent 0ae1cdfc8c
commit 6b62ba0e91
6 changed files with 14 additions and 14 deletions

View File

@@ -47,7 +47,7 @@ class Legislation::Proposal < ActiveRecord::Base
scope :sort_by_most_commented, -> { reorder(comments_count: :desc) }
scope :sort_by_title, -> { reorder(title: :asc) }
scope :sort_by_id, -> { reorder(id: :asc) }
scope :sort_by_supports, -> { reorder(cached_votes_up: :desc) }
scope :sort_by_supports, -> { reorder(cached_votes_score: :desc) }
scope :sort_by_random, -> { reorder("RANDOM()") }
scope :sort_by_flags, -> { order(flags_count: :desc, updated_at: :desc) }
scope :last_week, -> { where("proposals.created_at >= ?", 7.days.ago)}