aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--app/models/blog_post.rb6
1 files changed, 5 insertions, 1 deletions
diff --git a/app/models/blog_post.rb b/app/models/blog_post.rb
index 1d01a20..ed1e14c 100644
--- a/app/models/blog_post.rb
+++ b/app/models/blog_post.rb
@@ -26,7 +26,7 @@ class BlogPost < ActiveRecord::Base
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
end
@@ -51,6 +51,10 @@ class BlogPost < ActiveRecord::Base
:scoping => 'blog'
})
end
+
+ def uncategorized
+ posts = BlogPost.live.reject { |p| p.categories.any? }
+ end
end
module ShareThis