I need find movies with tags I have PostgeSQL array
add_column :movies, :string_tags, :text, array:true, default: []
And i have a array in html params
tags[]=test1&tags[]=test2
How i can connect them?
Movie.where("string_tags @> ?", params[:tags])
Not work
PG::Error: ERROR: array value must start with "{" or dimension information
LINE 1: ...CT "movies".* FROM "movies" WHERE (string_tags @> 'test1','test2...
For example, Movie.where("string_tags @> ?", "{"+params[:test].join(",")+"}")
work, I don't think this is a good solution