diff options
author | Emilio Tagua <miloops@gmail.com> | 2010-03-12 11:34:01 -0300 |
---|---|---|
committer | Emilio Tagua <miloops@gmail.com> | 2010-03-12 11:34:01 -0300 |
commit | 602722922c8365afcb3e9bed3721d61756322353 (patch) | |
tree | 8e07cc7fdf6662b77f4c7b0fb9aa6ccf55c7530a /lib/arel/algebra/relations | |
parent | 5e76aa7962c4e02c67c1e1515e6ae1b5ca6190a7 (diff) | |
parent | cbb524122c6132ba37661934c09b540a68b1c64d (diff) | |
download | rails-602722922c8365afcb3e9bed3721d61756322353.tar.gz rails-602722922c8365afcb3e9bed3721d61756322353.tar.bz2 rails-602722922c8365afcb3e9bed3721d61756322353.zip |
Merge branch 'master' of github.com:brynary/arel
Diffstat (limited to 'lib/arel/algebra/relations')
-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 |