method
_load_from_sql
v7.0.0 -
Show latest stable
-
0 notes -
Class: Querying
- 1.0.0
- 1.1.6
- 1.2.6
- 2.0.3
- 2.1.0
- 2.2.1
- 2.3.8
- 3.0.0
- 3.0.9
- 3.1.0
- 3.2.1
- 3.2.8
- 3.2.13
- 4.0.2
- 4.1.8
- 4.2.1
- 4.2.7
- 4.2.9
- 5.0.0.1
- 5.1.7
- 5.2.3
- 6.0.0
- 6.1.3.1
- 6.1.7.7
- 7.0.0 (0)
- 7.1.3.2 (0)
- 7.1.3.4 (0)
- What's this?
_load_from_sql(result_set, &block)
public
Hide source
# File activerecord/lib/active_record/querying.rb, line 57 def _load_from_sql(result_set, &block) # :nodoc: column_types = result_set.column_types unless column_types.empty? column_types = column_types.reject { |k, _| attribute_types.key?(k) } end message_bus = ActiveSupport::Notifications.instrumenter payload = { record_count: result_set.length, class_name: name } message_bus.instrument("instantiation.active_record", payload) do if result_set.includes_column?(inheritance_column) result_set.map { |record| instantiate(record, column_types, &block) } else # Instantiate a homogeneous set result_set.map { |record| instantiate_instance_of(self, record, column_types, &block) } end end end