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

              conditions = attrs.map do |attr, value|
                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)
                else
                  table_name = quoted_table_name
                end

                "#{table_name}.#{connection.quote_column_name(attr)} #{attribute_condition(value)}"
              end.join(' AND ')

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