I am using Rails with MongoDB and MongoMapper. My problem is that I have a class that is inheriting from another and I want to leave out one of the keys. For example:
class A
include MongoMapper::EmbeddedDocument
many :items
#Other keys I want
end
class Item < A
include MongoMapper::EmbeddedDocument
#Included Keys from A
#Other Keys that I want
end
The problem here is that Item inherits the relationship from A of many :items. How can I prevent that?
This:
indicates that that you don’t have a valid relationship for inheritance. Perhaps you want something more like this:
Trying to narrowing the interface of a derived class is a sign that you’re doing something wrong and need to rethink your hierarchy.