aboutsummaryrefslogtreecommitdiffstats
path: root/app/models
diff options
context:
space:
mode:
authorTom Russell <tom@cishub.co.uk>2012-11-22 21:42:12 +0000
committerPhilip Arndt <parndt@gmail.com>2012-11-23 10:54:40 +1300
commit788f9579c341f72d4bc2c34230deb7f5f6b6b06e (patch)
tree86685272a9b983f277859f301f9708b40b5453aa /app/models
parentb3db311954cdf10d29d998da88c20098dce6e53c (diff)
downloadrefinerycms-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.rb2
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)