Skip to content

Instantly share code, notes, and snippets.

@TGOlson
Last active December 26, 2015 12:09
Show Gist options
  • Save TGOlson/7149515 to your computer and use it in GitHub Desktop.
Save TGOlson/7149515 to your computer and use it in GitHub Desktop.
Speed up the process
desc "load all files in app/models to irb"
task :console do
file_list = Dir[File.dirname(__FILE__) + "/app/models/*.rb"].map { |f| "-r #{f}" }
exec "irb #{file_list.join(' ')}"
end
desc "generate new migration file"
task :generate do
timestamp = Time.now.strftime('%Y%m%d%H%M%S')
exec "touch db/migrate/#{timestamp}_#{ARGV.last}.rb"
end
# $ rake generate migration add_column_people ('migration' portion is optional)
# => 20131024214106_add_column_people.rb
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment