def validate_ranker_for_instance!
if ranker.scope && !instance_class.respond_to?(ranker.scope)
raise RankedModel::InvalidScope, %Q{No scope called "#{ranker.scope}" found in model}
end
if ranker.with_same
if (case ranker.with_same
when Symbol
!instance.respond_to?(ranker.with_same)
when Array
array_element = ranker.with_same.detect {|attr| !instance.respond_to?(attr) }
else
false
end)
raise RankedModel::InvalidField, %Q{No field called "#{array_element || ranker.with_same}" found in model}
end
end
end