aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNick Kallen <nkallen@nick-kallens-computer-2.local>2008-04-19 20:40:47 -0700
committerNick Kallen <nkallen@nick-kallens-computer-2.local>2008-04-19 20:40:47 -0700
commit9567f8e4e87f95929f331a2d5eb35bce952eac86 (patch)
tree362b11356c5853ce4217fbfb8ad22d4c97285f4f
parent86885933c42a620026d6d5a9fab2a22bcfdc1f79 (diff)
downloadrails-9567f8e4e87f95929f331a2d5eb35bce952eac86.tar.gz
rails-9567f8e4e87f95929f331a2d5eb35bce952eac86.tar.bz2
rails-9567f8e4e87f95929f331a2d5eb35bce952eac86.zip
- new todo items
- alias to_sql to to_s - added column_for to join (untested)
-rw-r--r--doc/TODO7
-rw-r--r--lib/arel/predicates.rb1
-rw-r--r--lib/arel/relations/join.rb5
3 files changed, 12 insertions, 1 deletions
diff --git a/doc/TODO b/doc/TODO
index 435684d77b..fc18af28b6 100644
--- a/doc/TODO
+++ b/doc/TODO
@@ -1,10 +1,14 @@
todo:
+- active record query adapter
+- audit active record quoting
- incorporate linq functionality/terminology
- then_by (ordering)
- reverse
- any/all
- where
-- fix complex joining cases:
+- limit clauses with left outer joins ?
+ - see add_limited_ids_condition
+ - select_limited_ids_list
- extract adapters
- cache expiry on write
- rewrite of arecord querycache test in light of this
@@ -61,6 +65,7 @@ done:
- test Value, in particular bind.
- test blank checks in relation.rb
- rename active_relation to arel
+- fix complex joining cases:
icebox:
- #bind in Attribute and Expression should be doing a descend?
diff --git a/lib/arel/predicates.rb b/lib/arel/predicates.rb
index ccaec1ad93..7faaebfc17 100644
--- a/lib/arel/predicates.rb
+++ b/lib/arel/predicates.rb
@@ -23,6 +23,7 @@ module Arel
def to_sql(formatter = nil)
"#{operand1.to_sql} #{predicate_sql} #{operand1.format(operand2)}"
end
+ alias_method :to_s, :to_sql
end
class Equality < Binary
diff --git a/lib/arel/relations/join.rb b/lib/arel/relations/join.rb
index fb51ea0260..d5ec9d43bd 100644
--- a/lib/arel/relations/join.rb
+++ b/lib/arel/relations/join.rb
@@ -37,6 +37,11 @@ module Arel
end
end
+ # TESTME: Not sure which scenario needs this method, was driven by failing tests in ActiveRecord
+ def column_for(attribute)
+ (relation1[attribute] || relation2[attribute]).column
+ end
+
def joins
this_join = [
join_sql,