module ActiveRecord::ReadonlyAttributes::ClassMethods

def attr_readonly(*attributes)

ignore these fields.
Attributes listed as readonly will be used to create a new record but update operations will
def attr_readonly(*attributes)
  self._attr_readonly = Set.new(attributes.map { |a| a.to_s }) + (self._attr_readonly || [])
end

def readonly_attributes

Returns an array of all the attributes that have been specified as readonly.
def readonly_attributes
  self._attr_readonly
end