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

Validate uniqueness often fails

    • Type: Icon: Task Task
    • Resolution: Done
    • 4.0.0 final
    • Affects Version/s: None
    • Component/s: None
    • None

      The model:

      class Post
        include Mongoid::Document
      
        field :content, type: String
        field :date, type: DateTime
        field :slug, type: String
        field :title, type: String
      
        validates :title, presence: true, uniqueness: true
        validates :slug, presence: true, uniqueness: true
      
      end
      

      I tested with two records. One of the records is created twice. The other isn't duplicated.

      I will look at the specs/ tests for this later to confirm. But if anyone understands what's possibly wrong, it would be great if you let me know.

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

              Created:
              Updated:
              Resolved: