should query the correct collection on perform

This commit is contained in:
danielvincent 2010-11-04 12:58:24 -07:00
parent b33aa9a0fb
commit 9da7272e59

View file

@ -30,7 +30,7 @@ class Retraction
def perform receiving_user_id
Rails.logger.debug "Performing retraction for #{post_id}"
if Post.find_by_id(post_id)
if self.type.constantize.find_by_id(post_id)
unless Post.first(:diaspora_handle => person.diaspora_handle, :id => post_id)
raise "#{person.inspect} is trying to retract a post they do not own"
end