Anyone have an idea on how you search arrays stored in ActiveRecord models?

I posted a question and details on S/O

1 Like

If I use one text column to store multiple string values
I will store it as comma separated string
assuming those value will never contain comma

Then a “contain” query can be implemented using “like”

But I am not sure how you store the array yet

1 Like

its stored as a string

What’s the format?
comma separated?

You could use LIKE, but I think SO already gave you that answer. Depending on the database, you could have other options; Postgresql, for example, has built in text indexing that you could use. You could extract the individual array values and store them in another table.

1 Like