-
Notifications
You must be signed in to change notification settings - Fork 62
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
ruby_class attribute in every document #20
Comments
without the ruby_class we don't know which class to use when converting the document into a ruby object. also, you can't do things like finding all blog posts without knowing wether a particular document is a blog post or not. |
but what if every database have only one Model. as say that this database have documents which represent "Post" Model. |
do you have any specific reason to put every kind of document into a separate database? if not you might find your mindset stuck in SQL land... anyway if you have reasons to do so, then you can overwrite the to_hash method in CouchPotato and filter out the ruby_class attribute. |
thanks for your support ... as i will have a database to represent one Model.. the core model. but i'd like to ask .. is overwriting the to_hash method ... will not write the "ruby_class" in the document and also the dynamic views .. |
i don't know what you are talking about, can you rephrase your question? |
sorry, i'd like to ask how to ignore write the ruby_class property in the document. is overwriting to_hash method will cover the above. |
the auto generated view all check for the ruby_class, so you have to provide your own map function:
|
Hi,
couchdb document have attribute "ruby_class" in every and each document ..
while every database have and represent one model document
as in blog example the database represent model "Post" which have the attribute "comments" represent Comment Model .. why adding "ruby_class" in every Post and every Comment.
The text was updated successfully, but these errors were encountered: