Skip to content

Instantly share code, notes, and snippets.

View dwbutler's full-sized avatar

David Butler dwbutler

View GitHub Profile
# Tested with ActiveRecord 4.0.5
# Run using:
# BUNDLE_GEMFILE=gemfiles/rails_4.0.gemfile bundle console
require 'sqlite3'
require 'active_record'
require 'groupify/adapter/active_record'
ActiveSupport::VERSION::STRING
# => "4.0.5"
@dwbutler
dwbutler / db.rake
Created August 28, 2013 22:56 — forked from ches/db.rake
namespace :db do
desc 'Open a MongoDB console with connection parameters for the current Rails.env'
task :console, [:session] => :environment do |t, args|
session_name = args[:session] || :default
config = Mongoid.sessions[session_name]
username = config[:username]
password = config[:password]
database = config[:database]