aboutsummaryrefslogtreecommitdiffstats
path: root/lib/arel
diff options
context:
space:
mode:
Diffstat (limited to 'lib/arel')
-rw-r--r--lib/arel/relations/recursion.rb17
1 files changed, 17 insertions, 0 deletions
diff --git a/lib/arel/relations/recursion.rb b/lib/arel/relations/recursion.rb
new file mode 100644
index 0000000000..2c6024dc30
--- /dev/null
+++ b/lib/arel/relations/recursion.rb
@@ -0,0 +1,17 @@
+module Arel
+ module Recursion
+ module BaseCase
+ def table
+ self
+ end
+
+ def relation_for(attribute)
+ self[attribute] and self
+ end
+
+ def table_sql(formatter = Sql::TableReference.new(self))
+ formatter.table self
+ end
+ end
+ end
+end \ No newline at end of file