From 788f9579c341f72d4bc2c34230deb7f5f6b6b06e Mon Sep 17 00:00:00 2001 From: Tom Russell Date: Thu, 22 Nov 2012 21:42:12 +0000 Subject: Modify to reorder (and so ignore default scope) when using Post.next s.t. the correct 'next' post is selected. Fixes #302 --- app/models/refinery/blog/post.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'app') diff --git a/app/models/refinery/blog/post.rb b/app/models/refinery/blog/post.rb index 4ee009e..d21447c 100644 --- a/app/models/refinery/blog/post.rb +++ b/app/models/refinery/blog/post.rb @@ -126,7 +126,7 @@ module Refinery end def next(current_record) - where(["published_at > ? and draft = ?", current_record.published_at, false]).with_globalize.first + where(["published_at > ? and draft = ?", current_record.published_at, false]).reorder('published_at ASC').with_globalize.first end def published_before(date=Time.now) -- cgit v1.2.3