lib/neo4j/active_node/labels.rb in neo4j-9.0.5 vs lib/neo4j/active_node/labels.rb in neo4j-9.0.6
- old
+ new
@@ -113,10 +113,10 @@
all.where(values).limit(1).query_as(:n).pluck(:n).first
end
# Like find_by, except that if no record is found, raises a RecordNotFound error.
def find_by!(values)
- find_by(values) || fail(RecordNotFound, "#{self.query_as(:n).where(n: values).limit(1).to_cypher} returned no results")
+ find_by(values) || fail(RecordNotFound.new("#{self.query_as(:n).where(n: values).limit(1).to_cypher} returned no results", name))
end
# Deletes all nodes and connected relationships from Cypher.
def delete_all
neo4j_query("MATCH (n:`#{mapped_label_name}`) OPTIONAL MATCH (n)-[r]-() DELETE n,r")