Methods

Instance Public methods

attr_readonly(*attributes)

Attributes listed as readonly will be used to create a new record but update operations will ignore these fields.

📝 Source code
# File activerecord/lib/active_record/readonly_attributes.rb, line 14
      def attr_readonly(*attributes)
        self._attr_readonly = Set.new(attributes.map(&:to_s)) + (_attr_readonly || [])
      end
🔎 See on GitHub

readonly_attributes()

Returns an array of all the attributes that have been specified as readonly.

📝 Source code
# File activerecord/lib/active_record/readonly_attributes.rb, line 19
      def readonly_attributes
        _attr_readonly
      end
🔎 See on GitHub