posts order by updated_at desc

This commit is contained in:
Patri
2014-04-14 11:22:36 +02:00
committed by Saverio Trioni
parent 134e5d851c
commit 605bdfa51e
+1 -1
View File
@@ -15,7 +15,7 @@ class Post < ActiveRecord::Base
foreign_key: "post_id",
association_foreign_key: "user_id"
default_scope ->{ order('posts.created_at DESC') }
default_scope ->{ order('posts.updated_at DESC') }
scope :by_category, ->(cat) { where(category_id: cat) if cat }