-
Notifications
You must be signed in to change notification settings - Fork 152
Ripple Associations
seancribbs edited this page Aug 13, 2010
·
6 revisions
- Key Correspondence
- Bucket correspondence
- Composition (embedding)
- Links
- One
- Many
- One
- Key Correspondence
- Inverted Bucket Correspondence
- Composition
- Links
- Many
- Bucket Correspondence
- Composition
- Links
- one_key_proxy
- one_embedded_proxy
- one_bucket_proxy
- one_link_proxy
- many_embedded_proxy
- many_link_proxy
- many_bucket_proxy
- Embedded
- There is no belongs to embedded proxy as the embedded document is
already aware of its parent document via methods in embedded_document.
An embedded document cannot change its parent once it has been saved.
- There is no belongs to embedded proxy as the embedded document is
- Link
- There is also no belongs to for link proxy. It would just be a “one” relationship
back in the other direction.
- There is also no belongs to for link proxy. It would just be a “one” relationship
- Key
- Key correspondence will require a matching class to have a “one” relationship.
This matching relationship acts as a belongs_to.
- Key correspondence will require a matching class to have a “one” relationship.
- Bucket
- The independent class will have to define how the bucket name will be defined (maybe sensible default, with configurable proc).
- The dependent class will have to determine the independent instance by the bucket name (using a sensible default or configurable proc). ** Acting as the dependent class will also require modification of the bucket_name method or some other hackery to determine the bucket.
Thoughts on a proxy class method.
Ideally one_association, many_association, embedded_association, link_association
will be able to be abstracted into modules that will make most of the proxies
little more than specific implementation. This may not be possible however.
In adding the associations, we’ll be adding an integration/ripple folder
that will use a ripple_test bucket.
one :avatar
one :invoice, :using => :key
many :friends, :class_name => 'User'
- Polymorphic associations
- Automatic “inverse of” assignment/updating
- Bucket associations
- One/Many Embedded Associations
- One/Many Linked Associations
- One/One Key Associations
- Wish list