Uploaded image for project: 'Mongoid'
  1. Mongoid
  2. MONGOID-2134

Raises useless validation errors

      I just can't get my head around this. How can it be that when I do on console something like this:

      Event.create!
      

      An error is raised with the following useless error message.
      >Mongoid::Errors::Validations: {:message=>"Validation of %

      {document}

      failed.", :summary=>"The following errors were found: %

      {errors}", :resolution=>"Try persisting the document with valid data or remove the validations."}

      I mean sure ok I now know there's a validation error, but no idea what so ever which validations are failing.. I suppose the error messages should be where there's just "%{errors}

      ", but obviously they are not.

      Sure I could just do:

      e = Event.create
      puts e.errors.inspect #or something..
      

      But the problem actually sprung from using Fabricator for feeding some random stuff on my local dev database for testing ui. Thus I can't use the easy way of going around this and neither can I adapt it to work with Fabricator, because I can't use Fabricate.build 'cos it doesn't seem to work (it probably can't handle the complex relations properly, which is probably a bug in Fabricator...) and Fabricate.attributes_for(:event) fails withe the same error message as creating... so there is actually no way of telling what is wrong with the Fabricator definition.. at least not any easy way..

            Assignee:
            durran Durran Jordan
            Reporter:
            timolehto timolehto
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved: