instance method
_read_attribute
Ruby on Rails 6.1.7.10
Since v3.0.20 Last seen in v6.1.7.10Signature
_read_attribute(attr_name, &block)
This method exists to avoid the expensive primary_key check internally, without breaking compatibility with the read_attribute API
Parameters
-
attr_namereq -
blockblock
Source
# File activerecord/lib/active_record/attribute_methods/read.rb, line 35
def _read_attribute(attr_name, &block) # :nodoc
@attributes.fetch_value(attr_name, &block)
end
Defined in activerecord/lib/active_record/attribute_methods/read.rb line 35
· View on GitHub
· Improve this page
· Find usages on GitHub
Defined in ActiveRecord::AttributeMethods::Read