From a447f0d6129a90fa9baa3c8c1dc1e0ecd76bf692 Mon Sep 17 00:00:00 2001 From: Rafael Souza Date: Fri, 19 Aug 2011 13:59:51 -0300 Subject: [PATCH] add support for mysql2 when using sequel as adapter --- .../padrino-gen/generators/components/orms/sequel.rb | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/padrino-gen/lib/padrino-gen/generators/components/orms/sequel.rb b/padrino-gen/lib/padrino-gen/generators/components/orms/sequel.rb index b5ae3b81b..43c75f5db 100644 --- a/padrino-gen/lib/padrino-gen/generators/components/orms/sequel.rb +++ b/padrino-gen/lib/padrino-gen/generators/components/orms/sequel.rb @@ -13,11 +13,11 @@ def setup_orm db = @app_name.underscore require_dependencies 'sequel' require_dependencies case options[:adapter] - when 'mysql' - sequel.gsub!(/!DB_DEVELOPMENT!/, "\"mysql://localhost/#{db}_development\"") - sequel.gsub!(/!DB_PRODUCTION!/, "\"mysql://localhost/#{db}_production\"") - sequel.gsub!(/!DB_TEST!/,"\"mysql://localhost/#{db}_test\"") - 'mysql' + when 'mysql', 'mysql2' + sequel.gsub!(/!DB_DEVELOPMENT!/, "\"#{options[:adapter]}://localhost/#{db}_development\"") + sequel.gsub!(/!DB_PRODUCTION!/, "\"#{options[:adapter]}://localhost/#{db}_production\"") + sequel.gsub!(/!DB_TEST!/,"\"#{options[:adapter]}://localhost/#{db}_test\"") + options[:adapter] when 'postgres' sequel.gsub!(/!DB_DEVELOPMENT!/, "\"postgres://localhost/#{db}_development\"") sequel.gsub!(/!DB_PRODUCTION!/, "\"postgres://localhost/#{db}_production\"")