instance method
[]
Ruby on Rails 3.0.20
Since v2.2.3 Last seen in v3.0.20Signature
[](attr_name)
Returns the value of the attribute identified by attr_name after it has been typecast (for example, “2004-12-12” in a data column is cast to a date object, like Date.new(2004, 12, 12)). (Alias for the protected read_attribute method).
Parameters
-
attr_namereq
Source
# File activerecord/lib/active_record/base.rb, line 1528
def [](attr_name)
read_attribute(attr_name)
end
Defined in activerecord/lib/active_record/base.rb line 1528
· View on GitHub
· Improve this page
· Find usages on GitHub
Defined in ActiveRecord::Base