aboutsummaryrefslogtreecommitdiffstats
path: root/lib/active_relation/relations
diff options
context:
space:
mode:
authorNick Kallen <nkallen@nick-kallens-computer-2.local>2008-02-18 11:31:14 -0800
committerNick Kallen <nkallen@nick-kallens-computer-2.local>2008-02-18 11:31:14 -0800
commitb0eb6244122a5fd86beaaabb6381835aebb139d4 (patch)
treed8ba1f2e48dca3b5d409144b62ea7b6dc4427f3a /lib/active_relation/relations
parent7354602f6f11db09f7e58a833dcf9cb141abf50a (diff)
downloadrails-b0eb6244122a5fd86beaaabb6381835aebb139d4.tar.gz
rails-b0eb6244122a5fd86beaaabb6381835aebb139d4.tar.bz2
rails-b0eb6244122a5fd86beaaabb6381835aebb139d4.zip
rename __collect__ to descend since the double underscores were ugly.
Diffstat (limited to 'lib/active_relation/relations')
-rw-r--r--lib/active_relation/relations/aggregation.rb4
-rw-r--r--lib/active_relation/relations/alias.rb4
-rw-r--r--lib/active_relation/relations/compound.rb2
-rw-r--r--lib/active_relation/relations/join.rb6
-rw-r--r--lib/active_relation/relations/order.rb4
-rw-r--r--lib/active_relation/relations/projection.rb4
-rw-r--r--lib/active_relation/relations/range.rb4
-rw-r--r--lib/active_relation/relations/relation.rb2
-rw-r--r--lib/active_relation/relations/rename.rb4
-rw-r--r--lib/active_relation/relations/selection.rb4
10 files changed, 19 insertions, 19 deletions
diff --git a/lib/active_relation/relations/aggregation.rb b/lib/active_relation/relations/aggregation.rb
index bcdfaa7d53..de21d2f383 100644
--- a/lib/active_relation/relations/aggregation.rb
+++ b/lib/active_relation/relations/aggregation.rb
@@ -22,8 +22,8 @@ module ActiveRelation
end
protected
- def __collect__(&block)
- Aggregation.new(relation.__collect__(&block), :expressions => expressions.collect(&block), :groupings => groupings.collect(&block))
+ def descend(&block)
+ Aggregation.new(relation.descend(&block), :expressions => expressions.collect(&block), :groupings => groupings.collect(&block))
end
end
end \ No newline at end of file
diff --git a/lib/active_relation/relations/alias.rb b/lib/active_relation/relations/alias.rb
index cc6e9b09b8..0bfa895951 100644
--- a/lib/active_relation/relations/alias.rb
+++ b/lib/active_relation/relations/alias.rb
@@ -10,8 +10,8 @@ module ActiveRelation
self[attribute] and @alias
end
- def __collect__(&block)
- Alias.new(relation.__collect__(&block), @alias)
+ def descend(&block)
+ Alias.new(relation.descend(&block), @alias)
end
def ==(other)
diff --git a/lib/active_relation/relations/compound.rb b/lib/active_relation/relations/compound.rb
index a02fbbeef5..2839862987 100644
--- a/lib/active_relation/relations/compound.rb
+++ b/lib/active_relation/relations/compound.rb
@@ -10,7 +10,7 @@ module ActiveRelation
end
def qualify
- __collect__(&:qualify)
+ descend(&:qualify)
end
end
end \ No newline at end of file
diff --git a/lib/active_relation/relations/join.rb b/lib/active_relation/relations/join.rb
index a5d2b5355b..6185293c8a 100644
--- a/lib/active_relation/relations/join.rb
+++ b/lib/active_relation/relations/join.rb
@@ -15,7 +15,7 @@ module ActiveRelation
end
def qualify
- __collect__(&:qualify)
+ descend(&:qualify)
end
def attributes
@@ -49,8 +49,8 @@ module ActiveRelation
relation1.aggregation?? relation1.to_sql(Sql::Aggregation.new) : relation1.send(:table_sql)
end
- def __collect__(&block)
- Join.new(join_sql, relation1.__collect__(&block), relation2.__collect__(&block), *predicates.collect(&block))
+ def descend(&block)
+ Join.new(join_sql, relation1.descend(&block), relation2.descend(&block), *predicates.collect(&block))
end
end
end \ No newline at end of file
diff --git a/lib/active_relation/relations/order.rb b/lib/active_relation/relations/order.rb
index 90568a90ac..cee6278c80 100644
--- a/lib/active_relation/relations/order.rb
+++ b/lib/active_relation/relations/order.rb
@@ -12,8 +12,8 @@ module ActiveRelation
end
protected
- def __collect__(&block)
- Order.new(relation.__collect__(&block), *orders.collect(&block))
+ def descend(&block)
+ Order.new(relation.descend(&block), *orders.collect(&block))
end
end
end \ No newline at end of file
diff --git a/lib/active_relation/relations/projection.rb b/lib/active_relation/relations/projection.rb
index 3fb594e2bb..cd08a5aa54 100644
--- a/lib/active_relation/relations/projection.rb
+++ b/lib/active_relation/relations/projection.rb
@@ -17,8 +17,8 @@ module ActiveRelation
end
protected
- def __collect__(&block)
- Projection.new(relation.__collect__(&block), *projections.collect(&block))
+ def descend(&block)
+ Projection.new(relation.descend(&block), *projections.collect(&block))
end
end
end \ No newline at end of file
diff --git a/lib/active_relation/relations/range.rb b/lib/active_relation/relations/range.rb
index 5cc5db094d..14a86b8c65 100644
--- a/lib/active_relation/relations/range.rb
+++ b/lib/active_relation/relations/range.rb
@@ -20,8 +20,8 @@ module ActiveRelation
end
protected
- def __collect__(&block)
- Range.new(relation.__collect__(&block), range)
+ def descend(&block)
+ Range.new(relation.descend(&block), range)
end
end
end \ No newline at end of file
diff --git a/lib/active_relation/relations/relation.rb b/lib/active_relation/relations/relation.rb
index 1c48d8be02..7d33b42faf 100644
--- a/lib/active_relation/relations/relation.rb
+++ b/lib/active_relation/relations/relation.rb
@@ -104,7 +104,7 @@ module ActiveRelation
alias_method :to_s, :to_sql
protected
- def __collect__
+ def descend
yield self
end
diff --git a/lib/active_relation/relations/rename.rb b/lib/active_relation/relations/rename.rb
index 718dbfe30f..1705d9ba8c 100644
--- a/lib/active_relation/relations/rename.rb
+++ b/lib/active_relation/relations/rename.rb
@@ -19,8 +19,8 @@ module ActiveRelation
end
protected
- def __collect__(&block)
- Rename.new(relation.__collect__(&block), yield(attribute) => pseudonym)
+ def descend(&block)
+ Rename.new(relation.descend(&block), yield(attribute) => pseudonym)
end
private
diff --git a/lib/active_relation/relations/selection.rb b/lib/active_relation/relations/selection.rb
index 93e0e16dc5..f8cd235419 100644
--- a/lib/active_relation/relations/selection.rb
+++ b/lib/active_relation/relations/selection.rb
@@ -18,8 +18,8 @@ module ActiveRelation
relation.send(:selects) + [predicate]
end
- def __collect__(&block)
- Selection.new(relation.__collect__(&block), yield(predicate))
+ def descend(&block)
+ Selection.new(relation.descend(&block), yield(predicate))
end
end