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

Disable SCI when an inherited model changes its collection name #396

Closed
brianhempel opened this issue Mar 8, 2012 · 0 comments
Closed

Comments

@brianhempel
Copy link
Contributor

From discussion on the mailing list, MongoMapper should disable Single Collection Inheritance when a model sets a new collection name.

class Article
  include MongoMapper::Document
end

class SubArticle < Article
  set_collection_name "sub_articles"
end

SubArticle.collection.name # is currently correct, "sub_articles"
SubArticle.query.to_hash.keys # should be [:transformer], currently is [:transformer, :_type]

Code to negate is in sci.rb#L12-17

@cheald cheald closed this as completed in b6f75e0 Jul 7, 2013
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

1 participant