Miron
unread,May 10, 2011, 7:14:34 PM5/10/11Sign in to reply to author
Sign in to forward
You do not have permission to delete messages in this group
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to DataMapper MongoDB Adapter
I tried a simple object model with associations:
class Student
include DataMapper::Mongo::Resource
property :id, ObjectId
property :name, String
property :age, Integer
end
class CourseStudent
include DataMapper::Mongo::Resource
property :id, ObjectId
belongs_to :course
belongs_to :student
end
class Course
include DataMapper::Mongo::Resource
has n, :course_students
has n, :students, :through => :course_student
property :id, ObjectId
property :name, String
end
But it seems to create an invalid mapping to mongo, with just one
field for CourseStudent rather than three. Do associations not work
with the current adapter?