static public Method

Base.attr_readonly(*attributes)

Attributes listed as readonly can be set for a new record, but will be ignored in database updates afterwards.

Source Code

# File active_record/base.rb, line 863
def attr_readonly(*attributes)
  write_inheritable_attribute("attr_readonly", Set.new(attributes.map(&:to_s)) + (readonly_attributes || []))
end
Comments

Have your say
Please use Textile formatting (click here for a cheat sheet). Use <code/> and <pre/> for code samples.
Click here to login with OpenID to to post comments.