five_last_week
This commit is contained in:
@@ -64,7 +64,7 @@ module CommentableActions
|
|||||||
end
|
end
|
||||||
|
|
||||||
def tag_cloud
|
def tag_cloud
|
||||||
resource_model.tag_counts.order("#{resource_name.pluralize}_count": :desc, name: :asc).limit(20)
|
resource_model.last_week.tag_counts.order("#{resource_name.pluralize}_count": :desc, name: :asc).limit(5)
|
||||||
end
|
end
|
||||||
|
|
||||||
def load_featured_tags
|
def load_featured_tags
|
||||||
|
|||||||
@@ -34,7 +34,7 @@ class Debate < ActiveRecord::Base
|
|||||||
scope :sort_by_random, -> { reorder("RANDOM()") }
|
scope :sort_by_random, -> { reorder("RANDOM()") }
|
||||||
scope :sort_by_relevance, -> { all }
|
scope :sort_by_relevance, -> { all }
|
||||||
scope :sort_by_flags, -> { order(flags_count: :desc, updated_at: :desc) }
|
scope :sort_by_flags, -> { order(flags_count: :desc, updated_at: :desc) }
|
||||||
|
scope :last_week, -> { where("created_at >= ?", 7.days.ago)}
|
||||||
# Ahoy setup
|
# Ahoy setup
|
||||||
visitable # Ahoy will automatically assign visit_id on create
|
visitable # Ahoy will automatically assign visit_id on create
|
||||||
|
|
||||||
|
|||||||
@@ -40,7 +40,8 @@ class Proposal < ActiveRecord::Base
|
|||||||
scope :sort_by_random, -> { reorder("RANDOM()") }
|
scope :sort_by_random, -> { reorder("RANDOM()") }
|
||||||
scope :sort_by_relevance , -> { all }
|
scope :sort_by_relevance , -> { all }
|
||||||
scope :sort_by_flags, -> { order(flags_count: :desc, updated_at: :desc) }
|
scope :sort_by_flags, -> { order(flags_count: :desc, updated_at: :desc) }
|
||||||
|
scope :last_week, -> { where("created_at >= ?", 7.days.ago)}
|
||||||
|
|
||||||
pg_search_scope :pg_search, {
|
pg_search_scope :pg_search, {
|
||||||
against: {
|
against: {
|
||||||
title: 'A',
|
title: 'A',
|
||||||
|
|||||||
Reference in New Issue
Block a user