
:type for undefined value is ignored
Reported by Dmytrii Nagirniak | December 7th, 2011 @ 07:21 AM
class User < Neo4j::Model
property :status, :type => :definitely_wrong_and_not_existing,
:default => :active end
This should raise error instead of falling back to the default converter.
Comments and changes to this ticket
-
Andreas Ronge December 7th, 2011 @ 09:06 AM
- Assigned user set to Andreas Ronge
There is also no validation.
You can also do thisclass User include Neo4j::NodeMixin property :name, :type => String end u = User.new u.name = 42
-
Dmytrii Nagirniak December 7th, 2011 @ 09:40 AM
The main issue is not the validation. It's a wrong converter.
To me it's ok to be able to assign integer to a string property (as long as getter always returns a string).
I would say it is totally different issue (if an issue at all).
But non-existing converter requires me to test every single property of non-default which is just a huge overkil. It should just blow up if I do something really wrong.
-
Andreas Ronge December 7th, 2011 @ 10:06 AM
The getter does not return a String in the example above.
Maybe that should be another issue.
Yes, I guess it is an easy thing to fix this. Pull requests are welcome :-) -
Dmytrii Nagirniak December 7th, 2011 @ 10:33 AM
There you go. This PR solves issues with String conversion.
But the original issue still applies.
-
Andreas Ronge December 7th, 2011 @ 10:41 AM
(from [8cd9ba5f766eb657150e4c8ba5295a244d6fd77d]) Merge pull request #80 from dnagir/string_converter
add string converter [#204]
https://github.com/andreasronge/neo4j/commit/8cd9ba5f766eb657150e4c... -
Dmytrii Nagirniak December 10th, 2011 @ 04:03 PM
I have fixed the issue with the
type => :definitely_wrong_and_not_existing
.Please check out the PR: https://github.com/andreasronge/neo4j/pull/86
-
Dmytrii Nagirniak December 14th, 2011 @ 11:56 PM
It has already been fixes, so can be closed I suppose.
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