From 915606d10923e3c5de6d904b58eb13b9b5658ea4 Mon Sep 17 00:00:00 2001 From: Carl Lerche Date: Thu, 11 Mar 2010 11:15:52 -0800 Subject: Latest ActiveSupport replaces metaclass with singleton_class --- lib/arel/session.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'lib') diff --git a/lib/arel/session.rb b/lib/arel/session.rb index d844cd7423..c7fcc53a3b 100644 --- a/lib/arel/session.rb +++ b/lib/arel/session.rb @@ -11,13 +11,13 @@ module Arel begin @started = true @instance = manufacture - metaclass.class_eval do + singleton_class.class_eval do undef :new alias_method :new, :instance end yield ensure - metaclass.class_eval do + singleton_class.class_eval do undef :new alias_method :new, :manufacture end -- cgit v1.2.3 From 9e3450dd830caa8d1c12a0ce33b3837dc29d779c Mon Sep 17 00:00:00 2001 From: Carl Lerche Date: Thu, 11 Mar 2010 15:52:01 -0800 Subject: Get the specs to start when an AR connection is not present. --- lib/arel.rb | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'lib') diff --git a/lib/arel.rb b/lib/arel.rb index 14511d5b38..ef2308ca53 100644 --- a/lib/arel.rb +++ b/lib/arel.rb @@ -1,6 +1,7 @@ require 'active_support/inflector' -require 'active_support/core_ext/module/delegation' require 'active_support/core_ext/class/attribute_accessors' +require 'active_support/core_ext/module/delegation' +require 'active_support/core_ext/object/blank' module Arel require 'arel/algebra' -- cgit v1.2.3 From e3461239adfa972de8f25a2bc6b48b4a8aa62c9c Mon Sep 17 00:00:00 2001 From: Carl Lerche Date: Thu, 11 Mar 2010 16:13:47 -0800 Subject: Start writing integration specs for arel. --- lib/arel/algebra/relations/operations/where.rb | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'lib') 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 -- cgit v1.2.3