On Rails 7.1, when setting config.active_record.query_log_tags_enabled to true, I get this error:
undefined method map' for nil`
def type_casted_binds(binds)
binds.map do |value|
if ActiveModel::Attribute === value
type_cast(value.value_for_database)
else
in [activerecord (7.1.2) lib/active_record/connection_adapters/abstract/quoting.rb:235:in type_casted_binds']`
We always go into this line:
result = connection.select_all(sanitize_sql([ query, values ]), "#{name} Load", nil, preparable: false)
and binds are nil because connection.prepare_statements? is false, due to https://github.com/rails/rails/blob/581074c40d0989ff1d981086043b40dc8daa4888/activerecord/lib/active_record/railtie.rb#L422