Commit d10a7713 by John Hawthorn

Remove README advice on sentinel values

I think this advice is misleading for most datasets and most RDBMS this
is not necessary, and as per #206 doesn't even work.

I have moved it to the wiki
https://github.com/radar/paranoia/wiki/Custom-sentinel-values
parent 18162f63
......@@ -184,27 +184,6 @@ You can replace the older `acts_as_paranoid` methods as follows:
The `recover` method in `acts_as_paranoid` runs `update` callbacks. Paranoia's
`restore` method does not do this.
## Support for Unique Keys with Null Values
Most databases ignore null columns when it comes to resolving unique index
constraints. This means unique constraints that involve nullable columns may be
problematic. Instead of using `NULL` to represent a not-deleted row, you can pick
a value that you want paranoia to mean not deleted. Note that you can/should
now apply a `NOT NULL` constraint to your `deleted_at` column.
Per model:
```ruby
# pick some value
acts_as_paranoid sentinel_value: DateTime.new(0)
```
or globally in a rails initializer, e.g. `config/initializer/paranoia.rb`
```ruby
Paranoia.default_sentinel_value = DateTime.new(0)
```
## License
This gem is released under the MIT license.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment