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

new_record? and Mongoid::Paranoia

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

      When using Paranoia, checking new_record? returns false if the object was previously deleted.

          @user= User.create email: 'test@example.com'
          @user.delete
          @new_user = User.find_or_create_by(email: 'test@example.com')
          @new_user.new_record?.should be
      

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

              Created:
              Updated:
              Resolved: