does it make sense to save the class name in a field when using inheritance with mongomapper/rails?
class Item
include MongoMapper::Document
timestamps!
key :class, String # does this actually make sense?
key :title, String
end
class Post < Item
key :body1, String
end
class Page < Item
key :body2, String
end
if a search for Item is performed, MongoMapper would return Item Objects. it is not clear, which kind of objects they are. if we want to display an icon or something similar to distinguish the items from each other, it could be done by saving the class name in the db. does this make sense, or is there a better way?