Skip to content

Instantly share code, notes, and snippets.

@nagachika
nagachika / Rakefile
Created May 15, 2012 16:37 — forked from jugyo/Rakefile
the db:migrate task using ActiveRecord without Rails
require 'bundler/setup'
require 'active_record'
require 'logger'
namespace :db do
desc "Migrate the database through scripts in db/migrate. Target specific version with VERSION=x"
task :migrate => :environment do
ActiveRecord::Migrator.migrate('db/migrate', ENV["VERSION"] ? ENV["VERSION"].to_i : nil )
end
@nagachika
nagachika / gist:2703119
Created May 15, 2012 16:36 — forked from jugyo/gist:2624955
How to use ActiveSupport::Dependencies.autoload_paths
require 'active_support/dependencies'
ActiveSupport::Dependencies.autoload_paths << File.expand_path('../lib', __FILE__)