Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Embedded associations do not work #303

Open
mattsnyder opened this issue Oct 23, 2012 · 1 comment
Open

Embedded associations do not work #303

mattsnyder opened this issue Oct 23, 2012 · 1 comment

Comments

@mattsnyder
Copy link

If an embedded class has associations, they cannot be saved or accessed. Results in an error

NoMethodError: undefined method `robject' for ClassName

For example:

class Box
  include Ripple::Document
  many :sides
end

class Side
  include Ripple::EmbeddedDocument
  many :holes
  embedded_in :box
end

class Hole
  include Ripple::Document
  property :descriptor, String
end

s = Side.new
s.holes << Hole.new # Results in robject error mentioned above
@seancribbs
Copy link
Contributor

It should be an error to define a linked association on an embedded document. If you change it to :using => :stored_key, it should work.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants