aboutsummaryrefslogtreecommitdiffstats
path: root/lib/arel/engines/sql/christener.rb
diff options
context:
space:
mode:
Diffstat (limited to 'lib/arel/engines/sql/christener.rb')
-rw-r--r--lib/arel/engines/sql/christener.rb2
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/arel/engines/sql/christener.rb b/lib/arel/engines/sql/christener.rb
index 2c96020554..6160f244f7 100644
--- a/lib/arel/engines/sql/christener.rb
+++ b/lib/arel/engines/sql/christener.rb
@@ -5,7 +5,7 @@ module Arel
# FIXME: this exists because all objects hash the same. :'(
@used_names = Hash.new(0)
@relation_names = Hash.new do |hash, relation|
- name = relation.table_alias ? relation.table_alias : relation.name
+ name = relation.table_alias || relation.name
@used_names[name] += 1
hash[relation] = name + (@used_names[name] > 1 ? "_#{@used_names[name]}" : '')
end