mirror of
https://github.com/rails/rails.git
synced 2022-11-09 12:12:34 -05:00
adding bind value substitution
This commit is contained in:
parent
ef0cf143a9
commit
497218d5db
2 changed files with 15 additions and 0 deletions
|
@ -97,6 +97,12 @@ module ActiveRecord
|
|||
quote_column_name(name)
|
||||
end
|
||||
|
||||
# Returns a bind substitution value given a +column+ and list of current
|
||||
# +bind_values+
|
||||
def substitute_for(column, bind_values)
|
||||
Arel.sql '?'
|
||||
end
|
||||
|
||||
# REFERENTIAL INTEGRITY ====================================
|
||||
|
||||
# Override to turn off referential integrity while executing <tt>&block</tt>.
|
||||
|
|
|
@ -51,6 +51,15 @@ module ActiveRecord
|
|||
:timeout => 100
|
||||
assert_equal 'UTF-8', conn.encoding
|
||||
end
|
||||
|
||||
def test_bind_value_substitute
|
||||
conn = Base.sqlite3_connection :database => ':memory:',
|
||||
:adapter => 'sqlite3',
|
||||
:timeout => 100
|
||||
|
||||
bind_param = conn.substitute_for('foo', [])
|
||||
assert_equal Arel.sql('?'), bind_param
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
Loading…
Reference in a new issue