diff options
author | Carl Lerche <carllerche@mac.com> | 2010-03-11 16:13:47 -0800 |
---|---|---|
committer | Carl Lerche <carllerche@mac.com> | 2010-03-11 16:13:47 -0800 |
commit | e3461239adfa972de8f25a2bc6b48b4a8aa62c9c (patch) | |
tree | 3f90435e3c4350cc8af16eb5717dff1c19b2e297 /lib/arel/algebra | |
parent | 9e3450dd830caa8d1c12a0ce33b3837dc29d779c (diff) | |
download | rails-e3461239adfa972de8f25a2bc6b48b4a8aa62c9c.tar.gz rails-e3461239adfa972de8f25a2bc6b48b4a8aa62c9c.tar.bz2 rails-e3461239adfa972de8f25a2bc6b48b4a8aa62c9c.zip |
Start writing integration specs for arel.
Diffstat (limited to 'lib/arel/algebra')
-rw-r--r-- | lib/arel/algebra/relations/operations/where.rb | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/lib/arel/algebra/relations/operations/where.rb b/lib/arel/algebra/relations/operations/where.rb index 608aaeb4b7..2fc51c7f24 100644 --- a/lib/arel/algebra/relations/operations/where.rb +++ b/lib/arel/algebra/relations/operations/where.rb @@ -9,6 +9,15 @@ module Arel @predicate = predicate.bind(@relation) end + def engine + # Temporary check of whether or not the engine supports where. + if relation.engine.respond_to?(:supports) && !relation.engine.supports(:where) + Memory::Engine.new + else + relation.engine + end + end + def wheres @wheres ||= (relation.wheres + [predicate]).collect { |p| p.bind(self) } end |