Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

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

Closed
brianhempel opened this Issue · 0 comments

1 participant

@brianhempel

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 in b6f75e0
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.