def Foo < CouchRest::ExtendedDocument
end
def Bar < CouchRest::ExtendedDocument
end
For some reason, I do :
Bar.get 'document_id'
But 'document_id' is not a Bar. It's a Foo !
So we could expect to have a Foo object and it's methods. Instead of that, we have a Bar object.
So it seems that to create the object, CouchRest relies on the class we call it with.
Would it be possible to see to return the appropriate object, based on the couchrest-type attribute?
Issue from: http://github.com/couchrest/couchrest/issues#issue/20
Let's guess I have two models :
For some reason, I do :
But 'document_id' is not a Bar. It's a Foo ! So we could expect to have a Foo object and it's methods. Instead of that, we have a Bar object.
So it seems that to create the object, CouchRest relies on the class we call it with. Would it be possible to see to return the appropriate object, based on the couchrest-type attribute?