Hey
I am pretty new to Ruby on Rails and I have no idea how to solve the following:
I have a join query on a table like this:
def mytags Taggable.joins("JOIN taggables as filter ON taggables.tag_id = filter.tag_id WHERE filter.taggable_type = 'User' AND filter.taggable_id = 1").all end
this works perfectly fine. then I want to join the result on another table, where OtherTable.joins(@mytags) works also fine BUT I want to join on two other colums and NOT on the ids....
Can anyone tell me how to do this? thx