Create a gist now

Instantly share code, notes, and snippets.

What would you like to do?
# FIX for this issue
# https://github.com/thoughtbot/shoulda-matchers/commit/6b4035c11783a0588e78d3705bb9425b9b5f45b8
Shoulda::Matchers::ActiveRecord::AssociationMatcher.class_eval do
protected
def foreign_key
reflection.respond_to?(:foreign_key) ? reflection.foreign_key : reflection.primary_key_name
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment