refactored post mod queue

This commit is contained in:
albert
2011-07-22 13:35:40 -04:00
parent e06e17c4ba
commit 4828cef27d
18 changed files with 233 additions and 71 deletions

View File

@@ -2,9 +2,9 @@ class PostDisapproval < ActiveRecord::Base
belongs_to :post
belongs_to :user
validates_uniqueness_of :post_id, :scope => [:user_id]
def self.prune!
joins(:post).where("posts.is_pending = FALSE AND posts.is_flagged = FALSE").select("post_disapprovals.*").each do |post_disapproval|
joins(:post).where("posts.is_pending = FALSE AND posts.is_flagged = FALSE").each do |post_disapproval|
post_disapproval.destroy
end
end