Mysql2::Error: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ')' at line 1: SELECT articles
.* FROM articles
WHERE 1=0 ORDER BY field(id, )
というエラーが起きたのですが、どういうことなのでしょうか?
設定したhelperは以下の通りです
ids = Impression.where("created_at >= ?", 1.second.ago).where("created_at <= ?", Time.now).group(:impressionable_id).order('count_all desc').limit(10).count.keys Article.where(:id => ids).order("field(id, #{ids.join(',')})")
バッドをするには、ログインかつ
こちらの条件を満たす必要があります。