instance method
[]
Ruby on Rails 4.1.16
Since v4.1.16 Last seen in v4.2.9Available in: v4.1.16 v4.2.9
Signature
[](name)
No documentation comment.
Parameters
-
namereq
Source
# File activerecord/lib/active_record/attribute_methods.rb, line 40
def [](name)
@method_cache.compute_if_absent(name) do
safe_name = name.unpack('h*').first
temp_method = "__temp__#{safe_name}"
ActiveRecord::AttributeMethods::AttrNames.set_name_cache safe_name, name
@module.module_eval method_body(temp_method, safe_name), __FILE__, __LINE__
@module.instance_method temp_method
end
end
Defined in activerecord/lib/active_record/attribute_methods.rb line 40
· View on GitHub
· Improve this page
· Find usages on GitHub
Defined in ActiveRecord::AttributeMethods::AttributeMethodCache