instance method quote_bound_value

Ruby on Rails 7.1.6

Since v7.0.10 Last seen in v7.1.6

Available in: v7.0.10 v7.1.6

Signature

quote_bound_value(value)

Quote a value to be used as a bound parameter of unknown type. For example, MySQL might perform dangerous castings when comparing a string to a number, so this method will cast numbers to string.

Deprecated: Consider ‘Arel.sql(“… ? …”, value)` or sanitize_sql instead.

Parameters

value req
Source
# File activerecord/lib/active_record/connection_adapters/abstract/quoting.rb, line 57
      def quote_bound_value(value)
        ActiveRecord.deprecator.warn(<<~MSG.squish)
          #quote_bound_value is deprecated and will be removed in Rails 7.2.
          Consider Arel.sql(".. ? ..", value) or #sanitize_sql instead.
        MSG

        quote(cast_bound_value(value))
      end

Defined in activerecord/lib/active_record/connection_adapters/abstract/quoting.rb line 57 · View on GitHub · Improve this page · Find usages on GitHub

Defined in ActiveRecord::ConnectionAdapters::Quoting

Type at least 2 characters to search.

↑↓ navigate · open · esc close