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

brianhempel opened this Issue Mar 8, 2012 · 0 comments

1 participant


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

class SubArticle < Article
  set_collection_name "sub_articles"

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 in b6f75e0 Jul 7, 2013
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment