base_doc should be nil for unassociated casted models
This commit is contained in:
parent
027dd9a3ee
commit
91cd1d9c7b
3 changed files with 7 additions and 1 deletions
|
@ -30,7 +30,7 @@ module CouchRest
|
|||
# Gets a reference to the top level extended
|
||||
# document that a model is saved inside of
|
||||
def base_doc
|
||||
raise "Cannot call base_doc on a model that is not yet casted by a document" unless @casted_by
|
||||
return nil unless @casted_by
|
||||
@casted_by.base_doc
|
||||
end
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue