aboutsummaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
Diffstat (limited to 'lib')
-rw-r--r--lib/arel/predicates.rb1
-rw-r--r--lib/arel/relations/join.rb5
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,