Adds scope for archived proposals

This commit is contained in:
Alberto Garcia Cabeza
2016-09-07 12:57:53 +02:00
parent b107790039
commit 22487592cf
3 changed files with 3 additions and 0 deletions

View File

@@ -44,6 +44,7 @@ class Proposal < ActiveRecord::Base
scope :sort_by_random, -> { reorder("RANDOM()") }
scope :sort_by_relevance, -> { all }
scope :sort_by_flags, -> { order(flags_count: :desc, updated_at: :desc) }
scope :archived, -> { where("proposals.created_at <= ?", 1.year.ago)}
scope :last_week, -> { where("proposals.created_at >= ?", 7.days.ago)}
scope :retired, -> { where.not(retired_at: nil) }
scope :not_retired, -> { where(retired_at: nil) }

View File

@@ -302,6 +302,7 @@ en:
hot_score: most active
most_commented: most commented
relevance: relevance
archived: Archived
retired_proposals: Retired proposals
retired_proposals_link: "Proposals retired by the author"
retired_links:

View File

@@ -302,6 +302,7 @@ es:
hot_score: Más activas hoy
most_commented: Más comentadas
relevance: Más relevantes
archived: Archivadas
retired_proposals: Propuestas retiradas
retired_proposals_link: "Propuestas retiradas por sus autores"
retired_links: