Skip to content

Commit fbdc3c0

Browse files
committed
Update sqlserver.rb
1 parent 57cf215 commit fbdc3c0

File tree

1 file changed

+8
-9
lines changed

1 file changed

+8
-9
lines changed

lib/arel/visitors/sqlserver.rb

+8-9
Original file line numberDiff line numberDiff line change
@@ -127,10 +127,9 @@ def visit_Arel_Table(o, collector)
127127
# Apparently, o.engine.connection can actually be a different adapter
128128
# than sqlserver. Can be removed if fixed in ActiveRecord. See:
129129
# github.com/rails-sqlserver/activerecord-sqlserver-adapter/issues/450
130-
131-
o.class.engine.with_connection do |connection|
132-
table_name =
133-
begin
130+
table_name =
131+
begin
132+
o.class.engine.with_connection do |connection|
134133
if connection.respond_to?(:sqlserver?) && connection.database_prefix_remote_server?
135134
remote_server_table_name(o)
136135
else
@@ -139,12 +138,12 @@ def visit_Arel_Table(o, collector)
139138
rescue Exception
140139
quote_table_name(o.name)
141140
end
142-
143-
if o.table_alias
144-
collector << "#{table_name} #{quote_table_name o.table_alias}"
145-
else
146-
collector << table_name
147141
end
142+
143+
if o.table_alias
144+
collector << "#{table_name} #{quote_table_name o.table_alias}"
145+
else
146+
collector << table_name
148147
end
149148
end
150149

0 commit comments

Comments
 (0)