Skip to content
Browse files

Small fix to choose the adapter spec or base class based on respond_to?

  • Loading branch information...
1 parent 02c2a14 commit 99a242aa17ef8c06dea955620bb984ae3e93991e @nicksieger nicksieger committed Feb 2, 2012
Showing with 1 addition and 1 deletion.
  1. +1 −1 lib/arjdbc/jdbc/adapter.rb
View
2 lib/arjdbc/jdbc/adapter.rb
@@ -112,7 +112,7 @@ def configure_arel2_visitors(config)
if defined?(::Arel::Visitors::VISITORS)
visitors = ::Arel::Visitors::VISITORS
visitor = nil
- adapter_spec = config[:adapter_spec] || self.class
+ adapter_spec = [config[:adapter_spec], self.class].detect {|a| a && a.respond_to?(:arel2_visitors) }
adapter_spec.arel2_visitors(config).each do |k,v|
visitor = v
visitors[k] = v

0 comments on commit 99a242a

Please sign in to comment.
Something went wrong with that request. Please try again.