I don't think you can avoid having some knowledge of the specific subclass if you want the type set correctly, however you could streamline the code so there is far less code duplication. Something like:
class Vote
def self.cast_vote_of_type(params, subtype)
....first_or_create(value: value, type: subtype)
end
end
class Tag::Vote
def self.cast_vote(params)
cast_vote_of_type(params, self.class.name)
end
end