Is it possible to make sure that the property is always a symbol so that the spec below passes:
it "should allow string-ish status" do
u = User.new
u.status = 'invited'
u.status.should == :active
end
And the class:
class User < Neo4j::Model
property :status, :type => :ProbablySymbolIsNotAvailableButMustBeAWayToConvert, :default => :active
end
As the last resort, there must be some hook similar to ActiveRecord write_attribute/read_attribute?
Thanks,
Dmytrii
--
You received this message because you are subscribed to the Google Groups "neo4jrb" group.
To post to this group, send email to neo...@googlegroups.com.
To unsubscribe from this group, send email to neo4jrb+u...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/neo4jrb?hl=en.
From what I can see, this is because there is a 'DefaultConvertor' that's used as a fallback in case a convertor is not found - but I agree, your example should raise an error instead. Could you please raise a bug?
Please take a look at https://github.com/andreasronge/neo4j/blob/master/spec/type_converters/type_converters_spec.rb and
https://github.com/andreasronge/neo4j/blob/master/lib/neo4j/type_converters/type_converters.rb
(The spec shows how to add a new converter)