method

quote_bound_value

Importance_0
Ruby on Rails latest stable (v7.1.3.2) - 0 notes - Class: ClassMethods
quote_bound_value(value, c = connection) private

No documentation

This method has no description. You can help the Ruby on Rails community by adding new notes.

Hide source
# File activerecord/lib/active_record/sanitization.rb, line 227
        def quote_bound_value(value, c = connection)
          if value.respond_to?(:map) && !value.acts_like?(:string)
            values = value.map { |v| v.respond_to?(:id_for_database) ? v.id_for_database : v }
            if values.empty?
              c.quote(c.cast_bound_value(nil))
            else
              values.map! { |v| c.quote(c.cast_bound_value(v)) }.join(",")
            end
          else
            value = value.id_for_database if value.respond_to?(:id_for_database)
            c.quote(c.cast_bound_value(value))
          end
        end
Register or log in to add new notes.