ncbo / goo

Graph Oriented Objects (GOO) for Ruby. A RDF/SPARQL based ORM.
http://ncbo.github.io/goo/
Other
15 stars 6 forks source link

inverse_of breaks when not reloading/finding new instance #80

Closed palexander closed 11 years ago

palexander commented 11 years ago

There is a problem with inverse_of and associating objects. For example:

o = Ontology.new(blah, blah, blah)
o.save
os = OntologySubmission(blah, blah, blah)
os.ontology = o
os.save
o.submissions
=> []
o = Ontology.find("BLAH")
o.submissions
=> [#<LinkedData::Models::OntologySubmission >]
palexander commented 11 years ago

Also, reloading doesn't work:

o.load
=> Goo::Base::StatusException: Resource cannot be loaded if object contains attributes.
msalvadores commented 11 years ago

Added test to reproduce this. It seems it has been fixed already. We have changed how inverse attrs are loaded so probably that fixed it.