Skip to content

Instantly share code, notes, and snippets.

@messanjah
messanjah / joins_association_cache_miss.rb
Created August 22, 2017 00:07
ActiveRecord 5.1.3 Bug report: Joins does not populate association_cache for all records.
# frozen_string_literal: true
begin
require "bundler/inline"
rescue LoadError => e
$stderr.puts "Bundler version 1.10 or later is required. Please update your Bundler"
raise e
end
gemfile(true) do

Keybase proof

I hereby claim:

  • I am messanjah on github.
  • I am messanjah (https://keybase.io/messanjah) on keybase.
  • I have a public key whose fingerprint is 60AD 7036 8D4C 9F51 A206 0558 7B1C 2888 21E8 6075

To claim this, I am signing this object:

@messanjah
messanjah / structure_in_conflict
Last active January 21, 2019 14:16
Steps to commit a cleanly merged db/structure.sql file
Dealing with conflicts to db/structure.sql (when merging master)
$ git checkout master
# Change database.yml to point to database: clean (on localhost) in development env
# In one command:
# 1) drops the database specified in database.yml for current env ('clean' database)
# 2) creates a db with name specified in database.yml
# 3) loads master's structure into the database specified in database.yml