aboutsummaryrefslogtreecommitdiffstats
path: root/app
diff options
context:
space:
mode:
authorJoe Sak <joe@joesak.com>2010-12-15 19:41:08 -0600
committerJoe Sak <joe@joesak.com>2010-12-15 19:41:08 -0600
commitff0bd433c5a8d332cc8630cad8732ece57408320 (patch)
tree42db888a58f98846e404147b8cdaf82de65c40a2 /app
parent2a0dc92538e610b7821eda3487d9e1bf3fac64f2 (diff)
downloadrefinerycms-blog-ff0bd433c5a8d332cc8630cad8732ece57408320.tar.gz
refinerycms-blog-ff0bd433c5a8d332cc8630cad8732ece57408320.tar.bz2
refinerycms-blog-ff0bd433c5a8d332cc8630cad8732ece57408320.zip
The blog nav should not grab next & previous drafts :)
Diffstat (limited to 'app')
-rw-r--r--app/models/blog_post.rb4
1 files changed, 2 insertions, 2 deletions
diff --git a/app/models/blog_post.rb b/app/models/blog_post.rb
index 1fb9900..1887a97 100644
--- a/app/models/blog_post.rb
+++ b/app/models/blog_post.rb
@@ -18,8 +18,8 @@ class BlogPost < ActiveRecord::Base
scope :live, lambda { where( "published_at < ? and draft = ?", Time.now, false).order("published_at DESC") }
- scope :previous, lambda { |i| where(["published_at < ?", i.published_at]).order("published_at DESC").limit(1) }
- scope :next, lambda { |i| where(["published_at > ?", i.published_at]).order("published_at ASC").limit(1) }
+ scope :previous, lambda { |i| where(["published_at < ? and draft = ?", i.published_at, false]).order("published_at DESC").limit(1) }
+ scope :next, lambda { |i| where(["published_at > ? and draft = ?", i.published_at, false]).order("published_at ASC").limit(1) }
def next
self.class.next(self).first