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
|
@ -28,6 +28,7 @@ CouchRest::CastedModel.class_eval do
|
|||
# The to_param method is needed for rails to generate resourceful routes.
|
||||
# In your controller, remember that it's actually the id of the document.
|
||||
def id
|
||||
return nil if base_doc.nil?
|
||||
base_doc.id
|
||||
end
|
||||
alias_method :to_param, :id
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue