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

Feature: .attr_readonly, .readonly_attributes

    • Type: Icon: Task Task
    • Resolution: Done
    • 3.0.0
    • Affects Version/s: None
    • Component/s: None
    • Labels:

      ActiveRecord supports marking attributes as read-only by using the attr_readonly method. Setting an attribute as read-only causes the following behavior:

      • ActiveRecord::Base#update_attribute (singular) will raise an exception if the attribute being set is read-only.
      • Any changes to attr_readonly attributes are simply filtered out when issuing updates to the database.

      ActiveRecord's counter caches are also automatically flagged with attr_readonly.

            Assignee:
            durran Durran Jordan
            Reporter:
            cgriego Chris Griego
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved: