I have 2 tables: 'Actor' & 'Role'. Each table has a column named 'ethnicity'. An Actor can only have 1 ethnicity, but a Role can have 1 or more ethnicities.
So for example, let's say I want to find all the roles that match Actor1's ethnicity below:
Actor1 - ethnicity: 'Asian'
Role1 - ethnicity: 'Asian'
Role2 - ethnicity: ['Asian','Caucasian']
This query:
Role.where{(ethnicity.eq my{actor.ethnicity})}
Will pull up Role1, but not Role2. My question is how do I construct a query that will pull up Role1 as well as Role2 in this example?
I've tried doing:
Role.where{(ethnicity.in my{actor.ethnicity})}
But that doesn't seem to work.
How to do this?