The code won't do anything if there are no elements, so there's no need to check that condition.
uniq
Rails/SafeNavigation
IndentationConsistency
Rails/Validation