diff options
author | Tom Russell <tom@cishub.co.uk> | 2012-11-22 21:42:12 +0000 |
---|---|---|
committer | Philip Arndt <parndt@gmail.com> | 2012-11-23 10:54:40 +1300 |
commit | 788f9579c341f72d4bc2c34230deb7f5f6b6b06e (patch) | |
tree | 86685272a9b983f277859f301f9708b40b5453aa /app/models | |
parent | b3db311954cdf10d29d998da88c20098dce6e53c (diff) | |
download | refinerycms-blog-788f9579c341f72d4bc2c34230deb7f5f6b6b06e.tar.gz refinerycms-blog-788f9579c341f72d4bc2c34230deb7f5f6b6b06e.tar.bz2 refinerycms-blog-788f9579c341f72d4bc2c34230deb7f5f6b6b06e.zip |
Modify to reorder (and so ignore default scope) when using Post.next s.t. the correct 'next' post is selected.
Fixes #302
Diffstat (limited to 'app/models')
-rw-r--r-- | app/models/refinery/blog/post.rb | 2 |
1 files changed, 1 insertions, 1 deletions
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) |