[](attr_name)
Instance Public methods
Returns the value of the attribute identified by attr_name
after it has been typecast (for example, â2004-12-12â in a date column is
cast to a date object, like Date.new(2004, 12, 12)). It raises
ActiveModel::MissingAttributeError if the identified attribute
is missing.
Alias for the read_attribute method.
class Person < ActiveRecord::Base
belongs_to :organization
end
person = Person.new(name: 'Francesco', age: '22')
person[:name] # =>