This commit is contained in:
albert
2011-06-25 16:33:30 -04:00
parent 1ad075c05a
commit 28d179708f
18 changed files with 113 additions and 23 deletions

View File

@@ -40,6 +40,8 @@ class Post < ActiveRecord::Base
scope :available_for_moderation, lambda {where(["id NOT IN (SELECT pd.post_id FROM post_disapprovals pd WHERE pd.user_id = ?)", CurrentUser.id])}
scope :hidden_from_moderation, lambda {where(["id IN (SELECT pd.post_id FROM post_disapprovals pd WHERE pd.user_id = ?)", CurrentUser.id])}
scope :tag_match, lambda {|query| Post.tag_match_helper(query)}
scope :positive, where("score > 1")
scope :negative, where("score < -1")
search_methods :tag_match
scope :after_id, Proc.new {|num|
if num.present?