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

Commit

Permalink
Explicitly wrap all raw queries in parenthesis
Browse files Browse the repository at this point in the history
* Prevents potential problems with OR conditions and other operators
  applying to more than just the intended statement

[#915 state:resolved]
  • Loading branch information
dkubb committed Jun 23, 2009
1 parent 7973cc5 commit 91f6fd4
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion lib/dm-core/adapters/data_objects_adapter.rb
Expand Up @@ -494,7 +494,8 @@ def conditions_statement(conditions, qualify = false)
comparison_statement(conditions, qualify)

when Array
conditions # handle raw conditions
statement, bind_values = conditions # handle raw conditions
[ "(#{statement})", bind_values ]
end
end

Expand Down

0 comments on commit 91f6fd4

Please sign in to comment.