diff options
author | Emilio Tagua <miloops@gmail.com> | 2010-02-16 10:14:40 -0300 |
---|---|---|
committer | Emilio Tagua <miloops@gmail.com> | 2010-02-16 10:14:40 -0300 |
commit | 7dc7cd5d6dffae18b41c07ac5c6e291d0ea8cd74 (patch) | |
tree | d28f5a8a55d171c1e719d29c79405b39dc45c847 /lib/arel/engines | |
parent | e4d6689f14960a6faf2aa6d6e1f7220e30eff549 (diff) | |
download | rails-7dc7cd5d6dffae18b41c07ac5c6e291d0ea8cd74.tar.gz rails-7dc7cd5d6dffae18b41c07ac5c6e291d0ea8cd74.tar.bz2 rails-7dc7cd5d6dffae18b41c07ac5c6e291d0ea8cd74.zip |
If a compiler is not found for the current adapter, use the generic one.
Diffstat (limited to 'lib/arel/engines')
-rw-r--r-- | lib/arel/engines/sql/relations/relation.rb | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/lib/arel/engines/sql/relations/relation.rb b/lib/arel/engines/sql/relations/relation.rb index 15903412d5..13e9f0a6a2 100644 --- a/lib/arel/engines/sql/relations/relation.rb +++ b/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)) |