Module: FastTrack::TrackMethods
Instance Method Summary collapse
-
#bundle_install ⇒ Object
Do a ‘bundle install`.
- #config ⇒ Object
-
#db_migrate! ⇒ Object
Do a ‘rake db:migrate`.
- #migration(migration_name, columns = {}) ⇒ Object
-
#model(model_name, columns = {}) ⇒ Object
Create a model ‘model_name`.
Instance Method Details
#bundle_install ⇒ Object
Do a ‘bundle install`
4 5 6 |
# File 'lib/fast_track/track_methods.rb', line 4 def bundle_install run "bundle install" end |
#config ⇒ Object
8 9 10 |
# File 'lib/fast_track/track_methods.rb', line 8 def config ::FastTrack.config end |
#db_migrate! ⇒ Object
Do a ‘rake db:migrate`
18 19 20 |
# File 'lib/fast_track/track_methods.rb', line 18 def db_migrate! rake "db:migrate" end |
#migration(migration_name, columns = {}) ⇒ Object
12 13 14 15 |
# File 'lib/fast_track/track_methods.rb', line 12 def migration(migration_name, columns = {}) migration_columns = columns.map {|k, v| "#{k}:#{v}" } generate "migration", migration_name, *migration_columns end |
#model(model_name, columns = {}) ⇒ Object
Create a model ‘model_name`
23 24 25 26 |
# File 'lib/fast_track/track_methods.rb', line 23 def model(model_name, columns = {}) model_columns = columns.map {|k, v| "#{k}:#{v}" } generate "model", model_name, *model_columns end |