Testing for ViewRow
This commit is contained in:
parent
4d1aebec43
commit
63bb1bb6bd
3 changed files with 73 additions and 3 deletions
|
@ -26,7 +26,7 @@ module CouchRest
|
|||
mapper.create_view_method(:all)
|
||||
|
||||
mapper.instance_eval(&block)
|
||||
|
||||
|
||||
req_design_doc_refresh
|
||||
end
|
||||
|
||||
|
|
|
@ -394,7 +394,7 @@ module CouchRest
|
|||
# value, or the ["value"]["_id"] used for linked documents.
|
||||
def doc
|
||||
return model.create_from_database(self['doc']) if self['doc']
|
||||
doc_id = (value && value['_id']) ? value['_id'] : self.id
|
||||
doc_id = (value.is_a?(Hash) && value['_id']) ? value['_id'] : self.id
|
||||
model.get(doc_id)
|
||||
end
|
||||
end
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue