architect4r icon indicating copy to clipboard operation
architect4r copied to clipboard

Cannot persist model data

Open cloud-on-prem opened this issue 13 years ago • 5 comments

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

cloud-on-prem avatar Dec 22 '11 15:12 cloud-on-prem

When exactly does this happen? Could you send me the failing code?

namxam avatar Jan 30 '12 16:01 namxam

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

ayqazi avatar Jun 05 '12 10:06 ayqazi

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?

pehrlich avatar Aug 05 '12 05:08 pehrlich

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 avatar Aug 05 '12 16:08 pehrlich

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.

joeyjoejoejr avatar Aug 08 '12 20:08 joeyjoejoejr