From 17a5fd13bc4ba8405d95e90d12b87dcd7e5bea5b Mon Sep 17 00:00:00 2001 From: Nick Kallen Date: Sun, 13 Jan 2008 18:44:48 -0800 Subject: strategy pattern --- lib/active_relation/relations/base.rb | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/lib/active_relation/relations/base.rb b/lib/active_relation/relations/base.rb index c464b6bc31..d90d8ae3e6 100644 --- a/lib/active_relation/relations/base.rb +++ b/lib/active_relation/relations/base.rb @@ -74,10 +74,6 @@ module ActiveRelation end include Operations - def connection - ActiveRecord::Base.connection - end - def to_sql(strategy = Sql::Select.new) strategy.select [ "SELECT #{attributes.collect{ |a| a.to_sql(Sql::Projection.new) }.join(', ')}", @@ -92,6 +88,10 @@ module ActiveRelation alias_method :to_s, :to_sql protected + def connection + ActiveRecord::Base.connection + end + def attributes; [] end def selects; [] end def orders; [] end -- cgit v1.2.3