This is just a heads up. While the couchDB adapter is very well done,
the relationships aren't set right.
The major problem is when you don't have a n to many relationship.
Many to Many relationships are messed up for instance. I understand
it's not really an easy thing to setup but I thing that by default, if
an Actor has many :movies and a Movie has many actors it should be
represented like that:
{"couchdb_type": "Movie", "actors" => ["actor_1_id", "actor_2_id"],
"_id": "movie_1", "_rev": 0 }
{"couchdb_type": "Actor", "movies" => ["movie_1_id"], "_id":
"actor_1", "_rev": 0 }
The challenge is to overwrite the default relationship behaviors and
to make sure the data stay in sync. Maybe a callback call can be sent
to upgrade relationships after one side was updated.
Anyway one should always use defined views instead of the useful but
slow dynamic views. If we only use static views (which we totally
should) we could store the relationship ids only on one of the 2
object types and define the relationships in the views.
What do you think?
p.s: I'm using a small module that I'm planning on extending, but it
defines some default stuff that I think are quite useful, some might
want to use it: http://gist.github.com/13430 I'm planning on maybe
adding a by_ view per param so we don't use temp view each time. Or
maybe we should let people compile their views using ruby:
Movie.create_view(:release_date, :order => [:release_date, :title])
What do you think?
-Matt
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"DataMapper" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/datamapper?hl=en
-~----------~----~----~----~------~----~------~--~---