When an investment had been assigned a user tag and a valuation tag with the same name, it appeared twice when filtering by tag. This is because by design, in order to provide compatibility with scopes using "select" or "distinct", the method `tagged_with` doesn't select unique records. Forcing the query to return unique records solves the issue.