I have a column of type String in the User model, this column is an array that is saved as a string. I need to check if there is an element in that array with the where clause. How can I do it?
I thought something like this:
scope :notified, ->(user){ where{array(tags).in [user.id] } }
But it does not work.
I have a column of type String in the User model, this column is an array that is saved as a string. I need to check if there is an element in that array with the where clause. How can I do it?
I thought something like this:
scope :notified, ->(user){ where{array(tags).in [user.id] } }But it does not work.