Skip to content

Commit

Permalink
Merge pull request padrino#637 from rafaelss/patch-1
Browse files Browse the repository at this point in the history
add support for mysql2 when using sequel as adapter
  • Loading branch information
DAddYE committed Aug 23, 2011
2 parents 187896c + a447f0d commit 635fdbf
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions padrino-gen/lib/padrino-gen/generators/components/orms/sequel.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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\"")
Expand Down

0 comments on commit 635fdbf

Please sign in to comment.