<commit_before># Paranoid Documents for Mongoid 4 [![Build Status](https://travis-ci.org/simi/mongoid-paranoia.png?branch=master)](https://travis-ci.org/simi/mongoid-paranoia)

# A lot of changes are in Mongoid 4 now and this is totally broken. I'll try to fix when Mongoid 4 API will be more stable.

There may be times when you don't want documents to actually get deleted from the database, but "flagged" as deleted. mongoid-paranoia provides a Paranoia module to give you just that.

Old API is froozen in [3.0.0-stable branch](https://github.com/simi/mongoid-paranoia/tree/3.0.0-stable) and works with Mongoid 4.

## Installation

Add this line to your application's Gemfile:

```ruby
gem 'mongoid-paranoia'
```

## Changes in 4.0
### [Uniqueness validator is not overriding default one](https://github.com/simi/mongoid-paranoia/commit/ce69dfeeb3f625535749ac919f2f643d47f3cdf4)

#### Old syntax:
```ruby
validates_uniqueness_of :title
validates :title, :uniqueness => true
```

#### New syntax:<commit_msg>We're green again! [ci skip]<commit_after># Paranoid Documents for Mongoid 4 [![Build Status](https://travis-ci.org/simi/mongoid-paranoia.png?branch=master)](https://travis-ci.org/simi/mongoid-paranoia)

There may be times when you don't want documents to actually get deleted from the database, but "flagged" as deleted. mongoid-paranoia provides a Paranoia module to give you just that.

Old API is froozen in [3.0.0-stable branch](https://github.com/simi/mongoid-paranoia/tree/3.0.0-stable) and works with Mongoid 4.

## Installation

Add this line to your application's Gemfile:

```ruby
gem 'mongoid-paranoia'
```

## Changes in 4.0
### [Uniqueness validator is not overriding default one](https://github.com/simi/mongoid-paranoia/commit/ce69dfeeb3f625535749ac919f2f643d47f3cdf4)

#### Old syntax:
```ruby
validates_uniqueness_of :title
validates :title, :uniqueness => true
```

#### New syntax:
{'fraction_non_alphanumeric': 0.12238493723849372, 'fraction_numerical': 0.03556485355648536, 'mean_word_length': 5.073015873015873, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 5, 'https://': 8, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1905050', 'n_tokens_mistral': 702, 'n_tokens_neox': 651, 'n_words': 193}