architect4r
architect4r copied to clipboard
Cannot persist model data
When I try to save! an instance, it throws up this error
NoMethodError: undefined method `fail_validate!' for MyClass:Class
I looked into your code and could not find the "fail_validate!" method. Could you please help?
Cheers -Prem
When exactly does this happen? Could you send me the failing code?
Hello,
I am having the same problem. All you have to do is define a validation in a model, and try to save an instance of that model while failing validation (i.e. save with a nil in a 'validates presence' field).
Thanks
I'm getting the same error -- rails 3.2.7:
> u = User.new
(Object doesn't support #inspect)
=>
> u.save
=> false
> u.save!
NoMethodError: undefined method `fail_validate!' for User:Class
from /Users/peter/.rvm/gems/ruby-1.9.3-p194/gems/architect4r-0.4.3.1/lib/architect4r/model/persistency.rb:17:in `save!'
My user.rb is fairly simple:
class User < Architect4r::Model::Node
property :name
end
Ideas?
So the only mention of fail_validate! which I can find on the web is here:
https://github.com/mongoid/mongoid/blob/master/lib/mongoid/persistence.rb#L308
Why would Architect4r be expecting a mongoid method?
pehrlich, you need to have your neo4j server running and set properly in an architecht4r.yml
The only way I was able to reproduce your error was when I shut my Neo4j server down. That error might should probably be caught, it is a bit confusing.