diff options
author | Nick Kallen <nkallen@nick-kallens-computer-2.local> | 2008-04-19 20:40:47 -0700 |
---|---|---|
committer | Nick Kallen <nkallen@nick-kallens-computer-2.local> | 2008-04-19 20:40:47 -0700 |
commit | 9567f8e4e87f95929f331a2d5eb35bce952eac86 (patch) | |
tree | 362b11356c5853ce4217fbfb8ad22d4c97285f4f /lib | |
parent | 86885933c42a620026d6d5a9fab2a22bcfdc1f79 (diff) | |
download | rails-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)
Diffstat (limited to 'lib')
-rw-r--r-- | lib/arel/predicates.rb | 1 | ||||
-rw-r--r-- | lib/arel/relations/join.rb | 5 |
2 files changed, 6 insertions, 0 deletions
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, |