Class: Recipes::Database
- Inherits:
-
Rails::AppBuilder
- Object
- Rails::AppBuilder
- Recipes::Database
- Defined in:
- lib/potassium/recipes/database.rb
Instance Method Summary collapse
Instance Method Details
#ask ⇒ Object
2 3 4 5 6 7 8 9 10 11 12 13 14 |
# File 'lib/potassium/recipes/database.rb', line 2 def ask databases = { postgresql: "PostgreSQL", mysql: "MySQL", none: "None, thanks" } database = answer(:db) do databases.keys[Ask.list("Which database are you using?", databases.values)] end set :database, database.to_sym end |
#create ⇒ Object
16 17 18 19 20 21 22 |
# File 'lib/potassium/recipes/database.rb', line 16 def create if db = databases(get(:database)) if db[:relational] activate_for_active_record(db) end end end |
#install ⇒ Object
24 25 26 27 |
# File 'lib/potassium/recipes/database.rb', line 24 def install ask create end |