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

Namespaced models produce unexpected results in has_many relationship. #40

Open
astjohn opened this issue Nov 28, 2012 · 2 comments
Open

Comments

@astjohn
Copy link

astjohn commented Nov 28, 2012

Using mongoid v3.x and railroady v1.1.0.
Here is an example:

class Shop::Apple
  include Mongoid::Document
  # etc..

  has_many :bugs
end

class Bug
  include Mongoid::Document
  #etc..
  belongs_to :apple, class_name: "Shop::Apple"
end 

The following would produce a has_many arrow pointing to a "Shop::Bug" model when it should point to the (also drawn) "Bug" model. This also occurs for embedded relationships and so the problem is probably valid across the board.

@afeld
Copy link

afeld commented Oct 18, 2015

Seeing this with ActiveRecord, as well.

@ranska
Copy link

ranska commented Jul 30, 2021

It look like there is a start of inprovement about namespaced model.
Here this is for aasm but it can maybe generalize for the rest ?

#123

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

No branches or pull requests

3 participants