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
CouchPotato.database.load_document does not instantiate the correct class #109
Comments
what does your user class look like? converting JSON back to ruby classes is actually done by the json gem. maybe some other gem is messing with that. can you check what |
class User
include CouchPotato::Persistence
property :name
end |
Sorry I'm not really sure how to help you. Can you post your entire/simplified code in a gist or so so I can reproduce the problem? |
Please check out this barebones rails project repo with only couch_potato gem and User class added https://github.com/pawurb/couch_potato_issue. You can replicate my issue with the following commands: CouchPotato::Config.database_name = 'test'
u = User.new(_id: 'uniq_id', name: 'test_user')
CouchPotato.database.save_document u
result = CouchPotato.database.load_document 'uniq_id'
result.class => CouchRest::Document I will be greatful for any clue on that. |
you are using version 0.7.1, the current version is 1.4.0 |
That explains a lot. Thanks ! |
Hello. I execute the following commands:
According to the docs the
result
object should be of classUser
(the one that includesCouchPotato::Persistence
module). I am new to non relational databases. Please let me know if I am doing something wrong.The text was updated successfully, but these errors were encountered: