In my models there is a many to many relation ship between games and users. How can I find all the games involving a given player?
I tried Game.all(Game.users.include?(u))
but got a NoMethodError
about include?
Here are my models per http://datamapper.org/docs/associations.html
class User
include DataMapper::Resource
property :id, Serial
has n, :games, :through => Resource
end
class Game
include DataMapper::Resource
property :id, Serial
has n, :users, :through => Resource
end