stub in preview for bulk revert

This commit is contained in:
Albert Yi
2016-11-01 16:47:46 -07:00
parent 91793fff82
commit 4e48e80e1f
6 changed files with 196 additions and 8 deletions

View File

@@ -1,12 +1,12 @@
class PostApproval < ActiveRecord::Base
belongs_to :user
belongs_to :post
belongs_to :user
belongs_to :post
def self.prune!
where("created_at < ?", 1.month.ago).delete_all
end
def self.prune!
where("created_at < ?", 1.month.ago).delete_all
end
def self.approved?(user_id, post_id)
where(user_id: user_id, post_id: post_id).exists?
end
def self.approved?(user_id, post_id)
where(user_id: user_id, post_id: post_id).exists?
end
end