This question is related to other: Many-to-many relationships with Ruby, Redis, and Ohm
I have a Model with a collection and I would like to look for an id. How can I do this?
Models
class User < Ohm::Model
attribute :name
end
class Event < Ohm::Model
attribute :title
collection :attendees, :User
end
Usage
@fran = User.create(name: "Fran")
@event = Event.create(title: "Party in Las Vegas")
@event.attendees.add(@fran)
Event.find(attendees: @fran)
=> Ohm::IndexNotFound exception!
What I would like is to be able to ask by the Users which attending of a Event and what are the Events by an User.