Remove duplicated scopes

This commit is contained in:
Alberto Miedes Garcés
2017-01-13 00:54:52 +01:00
parent 7a9373942a
commit f2eb8724d3

View File

@@ -1,9 +1,5 @@
class Vote < ActsAsVotable::Vote class Vote < ActsAsVotable::Vote
scope :for_debates, -> { where(votable_type: 'Debate') }
scope :for_proposals, -> { where(votable_type: 'Proposal') }
scope :for_comments, -> { where(votable_type: 'Comment') }
def self.public_for_api def self.public_for_api
joins("FULL OUTER JOIN debates ON votable_type = 'Debate' AND votable_id = debates.id"). joins("FULL OUTER JOIN debates ON votable_type = 'Debate' AND votable_id = debates.id").
joins("FULL OUTER JOIN proposals ON votable_type = 'Proposal' AND votable_id = proposals.id"). joins("FULL OUTER JOIN proposals ON votable_type = 'Proposal' AND votable_id = proposals.id").