    # File lib/active_record/base.rb, line 2302
            def sanitize_sql_hash_for_conditions(attrs, table_name = quoted_table_name)
              attrs = expand_hash_conditions_for_aggregates(attrs)

              conditions = attrs.map do |attr, value|
                unless value.is_a?(Hash)
                  attr = attr.to_s

                  # Extract table name from qualified attribute names.
                  if attr.include?('.')
                    table_name, attr = attr.split('.', 2)
                    table_name = connection.quote_table_name(table_name)
                  end

                  attribute_condition("#{table_name}.#{connection.quote_column_name(attr)}", value)
                else
                  sanitize_sql_hash_for_conditions(value, connection.quote_table_name(attr.to_s))
                end
              end.join(' AND ')

              replace_bind_variables(conditions, expand_range_bind_variables(attrs.values))
            end