Hi Filipe,
There should not be a problem with including both:
class Patient < CouchRest::Model::Base
belongs_to :clinical_sign
collection_of :clinical_signs
end
If you wanted to use shorter helper method names, you could also do:
class Patient < CouchRest::Model::Base
belongs_to :sign, class_name: 'ClinicalSign'
collection_of :signs, class_name: 'ClinicalSign'
end
These will of course store the ids of the associated ClinicalSign documents inside the Patient. If you wanted to embed a ClinicalSign object, you'd use the property field:
class Patient < CouchRest::Model::Base
property :clinical_sign, ClinicalSign
property :clinical_signs, [ClinicalSign]
end
Hope that helps.
sam