From 3373ec7e144b46e524a6558e8019653ab9e9e29f Mon Sep 17 00:00:00 2001 From: Dan Kubb Date: Sun, 22 Feb 2009 22:42:22 -0800 Subject: [PATCH] Fixed bind value handling for raw conditions in WHERE clause generation [#805 state:resolved] --- lib/dm-core/adapters/data_objects_adapter.rb | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/lib/dm-core/adapters/data_objects_adapter.rb b/lib/dm-core/adapters/data_objects_adapter.rb index 3c800639..02dc747b 100644 --- a/lib/dm-core/adapters/data_objects_adapter.rb +++ b/lib/dm-core/adapters/data_objects_adapter.rb @@ -347,7 +347,9 @@ def where_statement(conditions, qualify = false) statements = [] bind_values = [] - conditions.each do |operator, property, bind_value| + conditions.each do |tuple| + operator, property, bind_value = *tuple + # handle exclusive range conditions if bind_value.kind_of?(Range) && bind_value.exclude_end? @@ -378,8 +380,13 @@ def where_statement(conditions, qualify = false) bind_values << min bind_values << max else - statements << condition_statement(operator, property, bind_value, qualify) - bind_values << bind_value + statements << condition_statement(operator, property, bind_value, qualify) + + if operator == :raw + bind_values.push(*bind_value) if tuple.size == 3 + else + bind_values << bind_value + end end end