Skip to content

Commit

Permalink
mssql: warn for arel < 10 only
Browse files Browse the repository at this point in the history
  • Loading branch information
stackmystack committed Aug 8, 2024
1 parent 66fc2a0 commit 8c436ee
Showing 1 changed file with 6 additions and 9 deletions.
15 changes: 6 additions & 9 deletions lib/arel_extensions/visitors.rb
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,12 @@
rescue LoadError
warn 'arel/visitors/sqlserver not found: MSSQL might not work correctly.'
end
elsif RUBY_PLATFORM != 'java' && Arel::VERSION.to_i < 10
begin
require 'arel_sqlserver'
rescue LoadError
warn 'arel_sqlserver not found: SQLServer Visitor might not work correctly.'
end
end

require 'arel_extensions/visitors/convert_format'
Expand Down Expand Up @@ -41,15 +47,6 @@ def visit_Arel_SelectManager o
end
end

# Especially required here, not inside the next if, for Arel < 6.
if RUBY_PLATFORM != 'java'
begin
require 'arel_sqlserver'
rescue LoadError
warn 'gem arel_sqlserver not found: SQLServer Visitor might not work correctly.'
end
end

if defined?(Arel::Visitors::MSSQL)
class Arel::Visitors::MSSQL
include ArelExtensions::Visitors::MSSQL
Expand Down

0 comments on commit 8c436ee

Please sign in to comment.