-
Type: Improvement
-
Resolution: Fixed
-
Priority: Unknown
-
Affects Version/s: None
-
Component/s: None
-
None
-
Fully Compatible
In https://jira.mongodb.org/browse/MONGOID-5474 it was requested that a document can be marked readonly by overriding readonly? as follows:
def readonly? !status_was.eql?('locked') && status.eql?('locked') end
This usage is not currently documented - the only currently documented way of makinga document readonly is to call `document.readonly!` (as per AR).
- is related to
-
MONGOID-5478 Use "read-only" in documentation
- Closed
- related to
-
MONGOID-5474 Raise Mongoid::Errors::ReadonlyDocument when saving readonly documents
- Closed