jnunemaker/mongomapper — Issue #396: Disable SCI when an inherited model changes its collection name
Author: brianhempel
Created: 2012-03-08 23:01:59+00:00
State: open

From [discussion on the mailing list](http://groups.google.com/group/mongomapper/browse_thread/thread/b45dc6372fc8678e), MongoMapper should disable Single Collection Inheritance when a model sets a new collection name.

``` ruby
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 here here: [sci.rb#L12-17](https://github.com/jnunemaker/mongomapper/blob/master/lib/mongo_mapper/plugins/sci.rb#L12-17)