instance method _read_attribute

Ruby on Rails 6.1.7.10

Since v3.0.20 Last seen in v6.1.7.10

Available in: v3.0.20 v3.1.12 v6.0.6 v6.1.7.10

Signature

_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_name req
block block
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

Type at least 2 characters to search.

↑↓ navigate · open · esc close