Sha256: ace9baf148defcd0bc8d1f475c1c18668dc9b3e6e6587643ac889efddd11edd5
Contents?: true
Size: 1.52 KB
Versions: 3
Compression:
Stored size: 1.52 KB
Contents
## Upgrading Mongoid-Locker ## Upgrading to 2.0.0 Mongoid-Locker supports only `5`, `6` and `7` versions of Mongoid. Since this version `Mongoid::Locker` uses unique name of locking and time is set by MongoDB. `Mongoid::Locker` no longer uses `locked_until` field and this field may be deleted with `User.all.unset(:locked_until)`. You must define new `locking_name` field of `String` type. ```ruby class User include Mongoid::Document include Mongoid::Locker field :locking_name, type: String field :locked_at, type: Time end ``` The options `:timeout` and `retry_sleep` of `#with_lock` method was deprecated and have no effect. For details see [RubyDoc.info](https://www.rubydoc.info/gems/mongoid-locker/2.0.0/Mongoid/Locker#with_lock-instance_method). If you handle `Mongoid::Locker::LockError` error then this error should be renamed to `Mongoid::Locker::Errors::DocumentCouldNotGetLock`. ### Upgrading to 1.0.0 `Mongoid::Locker` no longer defines `locked_at` and `locked_until` fields when included. You must define these fields manually. ```ruby class User include Mongoid::Document include Mongoid::Locker field :locked_at, type: Time field :locked_until, type: Time end ``` You can customize the fields used with a `locker` class method or via a global `configure`. See [Customizable :locked_at and :locked_until field names](https://github.com/mongoid/mongoid-locker#customizable-locked_at-and-locked_until-field-names) for more information. See [#55](https://github.com/mongoid/mongoid-locker/pull/55) for more information.
Version data entries
3 entries across 3 versions & 1 rubygems
Version | Path |
---|---|
mongoid-locker-2.0.2 | UPGRADING.md |
mongoid-locker-2.0.1 | UPGRADING.md |
mongoid-locker-2.0.0 | UPGRADING.md |