method

substitute_values

Importance_0
v4.1.8 - Show latest stable - 0 notes - Class: ActiveRecord::Relation
substitute_values(values) public

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/relation.rb, line 89
    def substitute_values(values) # :nodoc:
      substitutes = values.sort_by { |arel_attr,_| arel_attr.name }
      binds       = substitutes.map do |arel_attr, value|
        [@klass.columns_hash[arel_attr.name], value]
      end

      substitutes.each_with_index do |tuple, i|
        tuple[1] = @klass.connection.substitute_at(binds[i][0], i)
      end

      [substitutes, binds]
    end
Register or log in to add new notes.