[]=(attr_name, value) public

Updates the attribute identified by attr_name using the specified value. The attribute value will be type cast upon being read.

class Person < ActiveRecord::Base
end

person = Person.new
person[:date_of_birth] = "2004-12-12"
person[:date_of_birth] # => Date.new(2004, 12, 12)
Show source
Register or log in to add new notes.