From 07a803c9f607b938f004b4adb6fe9abbad6fc8c4 Mon Sep 17 00:00:00 2001 From: Aaron Patterson Date: Mon, 26 Jul 2010 17:11:30 -0700 Subject: PERF: removing *args calls, do not call send on protected methods then they are public methods --- lib/arel/algebra/relations/relation.rb | 38 ++++++++++++++++------------------ 1 file changed, 18 insertions(+), 20 deletions(-) (limited to 'lib/arel/algebra') diff --git a/lib/arel/algebra/relations/relation.rb b/lib/arel/algebra/relations/relation.rb index 3f6151e27b..b89abd5b8a 100644 --- a/lib/arel/algebra/relations/relation.rb +++ b/lib/arel/algebra/relations/relation.rb @@ -62,31 +62,29 @@ module Arel end end - protected - - def from_clauses - sources.blank? ? table_sql(Sql::TableReference.new(self)) : sources - end + def select_clauses + attributes.collect { |a| a.to_sql(Sql::SelectClause.new(self)) } + end - def select_clauses - attributes.collect { |a| a.to_sql(Sql::SelectClause.new(self)) } - end + def from_clauses + sources.blank? ? table_sql(Sql::TableReference.new(self)) : sources + end - def where_clauses - wheres.collect { |w| w.to_sql(Sql::WhereClause.new(self)) } - end + def where_clauses + wheres.collect { |w| w.to_sql(Sql::WhereClause.new(self)) } + end - def group_clauses - groupings.collect { |g| g.to_sql(Sql::GroupClause.new(self)) } - end + def group_clauses + groupings.collect { |g| g.to_sql(Sql::GroupClause.new(self)) } + end - def having_clauses - havings.collect { |g| g.to_sql(Sql::HavingClause.new(self)) } - end + def having_clauses + havings.collect { |g| g.to_sql(Sql::HavingClause.new(self)) } + end - def order_clauses - orders.collect { |o| o.to_sql(Sql::OrderClause.new(self)) } - end + def order_clauses + orders.collect { |o| o.to_sql(Sql::OrderClause.new(self)) } + end module Enumerable include ::Enumerable -- cgit v1.2.3