model.save is returning true when there are validation errors

XMLWordPrintableJSON

    • None
    • None
    • None
    • None
    • None
    • None
    • None

      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
              Reporter:
              calebclark
              Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

                Created:
                Updated:
                Resolved: