
save fails with runtime exception instead of returning false
Reported by Gokul | August 29th, 2011 @ 04:24 PM
class Posting < Neo4j::Rails::Relationship
before_validation :do_some_checks
def do_some_checks
puts "CHECK"
false
end
end
class Blog < Neo4j::Rails::Model
has_n(:posts).relationship(Posting)
end
if for a post, the callback chain is halted (do_some_checks
returns false), then
blog.save throws a runtime exception instead of returning
false.
jruby-1.6.3 :007 > blog.save
RuntimeError: Can't save outgoing id: 2250 start_node: 8 end_node:
9
type:posts, validation errors ? #
lib/neo4j/rails/relationships/storage.rb:147:in
`persist'
lib/neo4j/rails/relationships/storage.rb:143:in
`persist'
lib/neo4j/rails/relationships/relationships.rb:8:in
`write_changed_relationships'
lib/neo4j/rails/relationships/relationships.rb:7:in
`write_changed_relationships
Comments and changes to this ticket
-
Andreas Ronge August 29th, 2011 @ 07:38 PM
Thanks for reporting this. I'm not sure when I will fix it. I guess it is not critical ?
-
-
Andreas Ronge April 19th, 2012 @ 10:35 AM
- State changed from new to resolved
(from [d321a276847faaea07ba13f93f7061c469006b50]) Add more YARD docs including Cypher/Rules closes #181 https://github.com/andreasronge/neo4j/commit/d321a276847faaea07ba13...
Please Sign in or create a free account to add a new ticket.
With your very own profile, you can contribute to projects, track your activity, watch tickets, receive and update tickets through your email and much more.
Create your profile
Help contribute to this project by taking a few moments to create your personal profile. Create your profile ยป
Neo4j.rb is a graph database framework for JRuby.
It provides:
* Mapping of ruby objects to nodes in networks rather than in tables.
* Storage of ruby object to a file system.
* Fast traversal of relationships between nodes in a hugh node space.
* Transaction with rollbacks support.
* Indexing and quering of ruby objects.
* Integration with Rails