Skip to content
This repository has been archived by the owner on Apr 17, 2018. It is now read-only.

Commit

Permalink
Fixed bind value handling for raw conditions in WHERE clause generation
Browse files Browse the repository at this point in the history
[#805 state:resolved]
  • Loading branch information
Dan Kubb committed Feb 23, 2009
1 parent ba23742 commit 3373ec7
Showing 1 changed file with 10 additions and 3 deletions.
13 changes: 10 additions & 3 deletions lib/dm-core/adapters/data_objects_adapter.rb
Expand Up @@ -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?

Expand Down Expand Up @@ -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

Expand Down

0 comments on commit 3373ec7

Please sign in to comment.