Permalink
Browse files

fix order of posts created the same day

  • Loading branch information...
1 parent 226a871 commit 3b0f301f21ec7e84bf603becf1b6cf2954c1f92e Jean-Philippe Boily committed Oct 12, 2012
Showing with 1 addition and 1 deletion.
  1. +1 −1 app/models/monologue/post.rb
@@ -7,7 +7,7 @@ class Monologue::Post < ActiveRecord::Base
attr_writer :tag_list
attr_accessible :posts_revisions_attributes, :published, :tag_list
- scope :default, includes(:posts_revisions).where("posts_revision_id = monologue_posts_revisions.id").order("published_at DESC")
+ scope :default, includes(:posts_revisions).where("posts_revision_id = monologue_posts_revisions.id").order("published_at DESC, monologue_posts.created_at DESC, monologue_posts.updated_at DESC")
scope :published, default.where(:published => true).where("published_at <= ?", DateTime.now)
default_scope includes(:tags)

0 comments on commit 3b0f301

Please sign in to comment.