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

Document readonly? override

    • Type: Icon: Improvement Improvement
    • Resolution: Fixed
    • Priority: Icon: Unknown Unknown
    • 8.1.0
    • 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).

            Assignee:
            neil.shweky@mongodb.com Neil Shweky (Inactive)
            Reporter:
            oleg.pudeyev@mongodb.com Oleg Pudeyev (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved: