changes to unambiguous order declaration.

Specified as a string referred table of 'created_at' was ambiguous, index failed when filtering by tag
This commit is contained in:
Juanjo Bazán
2015-08-19 13:45:17 +02:00
parent 0066cb0514
commit 10d7e9effe

View File

@@ -1,7 +1,7 @@
require 'numeric'
class Debate < ActiveRecord::Base
include ActsAsParanoidAliases
default_scope { order('created_at DESC') }
default_scope { order(created_at: :desc) }
apply_simple_captcha
TITLE_LENGTH = Debate.columns.find { |c| c.name == 'title' }.limit