diff options
Diffstat (limited to 'lib/arel/algebra/relations/operations/where.rb')
-rw-r--r-- | lib/arel/algebra/relations/operations/where.rb | 12 |
1 files changed, 2 insertions, 10 deletions
diff --git a/lib/arel/algebra/relations/operations/where.rb b/lib/arel/algebra/relations/operations/where.rb index 2fc51c7f24..6c9c5ed755 100644 --- a/lib/arel/algebra/relations/operations/where.rb +++ b/lib/arel/algebra/relations/operations/where.rb @@ -1,7 +1,8 @@ module Arel class Where < Compound attributes :relation, :predicate - deriving :== + deriving :== + requires :restricting def initialize(relation, *predicates, &block) predicate = block_given?? yield(relation) : predicates.shift @@ -9,15 +10,6 @@ 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 |