Permalink
Browse files

If a compiler is not found for the current adapter, use the generic one.

  • Loading branch information...
1 parent e4d6689 commit 7dc7cd5d6dffae18b41c07ac5c6e291d0ea8cd74 @miloops miloops committed Feb 16, 2010
Showing with 5 additions and 1 deletion.
  1. +5 −1 lib/arel/engines/sql/relations/relation.rb
@@ -2,7 +2,11 @@ module Arel
class Relation
def compiler
- @compiler ||= "Arel::SqlCompiler::#{engine.adapter_name}Compiler".constantize.new(self)
+ @compiler ||= begin
+ "Arel::SqlCompiler::#{engine.adapter_name}Compiler".constantize.new(self)
+ rescue
+ Arel::SqlCompiler::GenericCompiler.new(self)
+ end
end
def to_sql(formatter = Sql::SelectStatement.new(self))

0 comments on commit 7dc7cd5

Please sign in to comment.