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

model.save is returning true when there are validation errors

      I thought model.save is supposed to return false if there are errors in the validation. However, I just noticed that Mongoid 3 is returning true regardless of errors.

      I have this validation in my model:
      validates_uniqueness_of :_external_id, :scope => [:fanforce_id, :ff_action_id]

      which is returning the following error when I try to add a new record with a duplicate _external_id:

      {"_external_id":["is already taken"]}

      but model.save is returning true.

            Assignee:
            Unassigned Unassigned
            Reporter:
            calebclark calebclark
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved: