lib/potassium/templates/application/recipes/database.rb in potassium-1.3.2 vs lib/potassium/templates/application/recipes/database.rb in potassium-1.3.3
- old
+ new
@@ -1,14 +1,18 @@
def activate_for_active_record(db)
remove_file 'config/database.yml'
copy_file "assets/config/database_#{db[:name]}.yml", 'config/database.yml'
discard_gem 'sqlite3'
- gather_gem db[:gem_name]
+ if db[:version]
+ gather_gem db[:gem_name], db[:version]
+ else
+ gather_gem db[:gem_name]
+ end
end
databases = {
- mysql: { name: 'mysql', gem_name: 'mysql2', relational: true },
+ mysql: { name: 'mysql', gem_name: 'mysql2', version: '~> 0.3.18', relational: true },
postgresql: { name: 'postgresql', gem_name: 'pg', relational: true }
}
if db = databases[get(:database).to_sym]
if db[:relational]