I have an object with an array field, called emails
user.emails = ['[email protected]','[email protected]']
I want to find all the users from a list of emails:
emails_to_find = ['[email protected]','[email protected]']
I tried running
User.where(emails: emails_to_find)
but I get
ActiveRecord::StatementInvalid: PG::InvalidTextRepresentation: ERROR: array value must start with "{" or dimension information
How do I do that? What the error means?