I have two collections in my mongoDB of my Ruby on Rails Project, One with motions and an other one with actors. The motions have an attribute actor that contains the name of the actor and through which you can find him. I know want to find all the motions that belong to an actor of a specific gender. The code I use is the following.
found = Motion.all
found.each do |x|
n = x.actor
a = actors.where(:name => n).first
if a.gender != search_gender
found = found.where.not(:name => n)
end
end
But i always get the Error
wrong number of arguments (0 for 1)
it's supposed to be in this line:
found = found.where.not(:name => n)
but I dont really know what i did wrong here. Can anyone tell me or does anyone know a different way i could do this? I am not too familiar with rails so it could be a pretty stupid mistake. any help appreciated.