Closed palexander closed 11 years ago
There is a problem when using goo objects without making the model call in the class definition. It happens when there is a dependent object. See code below.
class Ontology < Goo::Base::Resource attribute :acronym, :unique => true, :cardinality => { :max => 1, :min => 1 } attribute :name, :cardinality => { :max => 1, :min => 1 } end class Project < Goo::Base::Resource attribute :name, :cardinality => { :max => 1, :min => 1 } attribute :ontologyUsed, :instance_of => { :with => :ontology }, :cardinality => { :min => 1 } end p = LinkedData::Models::Project.new({ :name => "Great Project", :ontologyUsed => [LinkedData::Models::Ontology.new(acronym: "SNOMED", name: "SNOMED CT")] }) assert_equal false, p.exist?(reload=true) p.save assert_equal true, p.exist?(reload=true) p.delete assert_equal false, p.exist?(reload=true)
The following code results in an error when running p.save: ArgumentError: Model ontology is not registered.
I have added the example code as test and it works. Probably one of the commits between when this was submitted and now fixed it.
There is a problem when using goo objects without making the model call in the class definition. It happens when there is a dependent object. See code below.
The following code results in an error when running p.save: ArgumentError: Model ontology is not registered.