No, ontologies.where("state != 'done'") gives something different. The state of an ontology version can be different from the state of its ontology. For example, it often occurs that the state of the ontology version is pending, but the state of the ontology is done. This is even legitimate if someone has just uploaded a new version for an ontology.