Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion lib/arel/visitors/sqlserver.rb
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,10 @@ def visit_Arel_Nodes_SelectStatement o, collector
end

def visit_Arel_Table o, collector
table_name = if o.engine.connection.database_prefix_remote_server?
# Apparently, o.engine.connection can actually be a different adapter
# than sqlserver. Can be removed if fixed in ActiveRecord. See:
# github.com/rails-sqlserver/activerecord-sqlserver-adapter/issues/450
table_name = if o.engine.connection.respond_to?(:sqlserver?) and o.engine.connection.database_prefix_remote_server?
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for this! I will be changing this to && unless there was a reason to use the lower version?

remote_server_table_name(o)
else
quote_table_name(o.name)
Expand Down