Validate uniqueness often fails

XMLWordPrintableJSON

    • Type: Task
    • Resolution: Done
    • 4.0.0 final
    • Affects Version/s: None
    • Component/s: None
    • None
    • None
    • None
    • None
    • None
    • None
    • 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
              Reporter:
              katgironpe
              Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

                Created:
                Updated:
                Resolved: