Merges master branch

This commit is contained in:
Alberto Garcia Cabeza
2016-01-18 11:33:49 +01:00
52 changed files with 2357 additions and 2506 deletions

View File

@@ -35,7 +35,7 @@ class Debate < 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 :last_week, -> { where("created_at >= ?", 7.days.ago)}
# Ahoy setup
visitable # Ahoy will automatically assign visit_id on create

View File

@@ -41,7 +41,8 @@ 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 :last_week, -> { where("created_at >= ?", 7.days.ago)}
pg_search_scope :pg_search, {
against: {
title: 'A',