Skip to content

Instantly share code, notes, and snippets.

View njakobsen's full-sized avatar

Nicholas Jakobsen njakobsen

View GitHub Profile
@rywall
rywall / gist:2039089
Created March 14, 2012 19:59
Identity Map Bug Fix
gem 'rails', :git => 'git://github.com/rails/rails.git', :ref => 'c1f397f82c7b3f352500832a399b5dbdc500b9c8'# change as required
require 'active_record'
require 'logger'
# Show ActiveRecord log output
ActiveRecord::Base.logger = Logger.new(STDOUT)
# Print out what version we're running
puts "Active Record #{ActiveRecord::VERSION::STRING}"
@njakobsen
njakobsen / dependent_delete_all_test.rb
Created November 18, 2011 01:46
Rails 3.1 poor handling of :dependent => :delete_all
require 'active_record'
require 'logger'
# Print out what version we're running
puts "Active Record #{ActiveRecord::VERSION::STRING}"
# Connect to an in-memory sqlite3 database (more on this in a moment)
ActiveRecord::Base.establish_connection(:adapter => 'sqlite3', :database => ':memory:')
# Create the minimal database schema necessary to reproduce the bug