diff --git a/activerecord/lib/active_record/core.rb b/activerecord/lib/active_record/core.rb
index <HASH>..<HASH> 100644
--- a/activerecord/lib/active_record/core.rb
+++ b/activerecord/lib/active_record/core.rb
@@ -162,6 +162,9 @@ module ActiveRecord
           v.nil? || Array === v || Hash === v
         }
 
+        # We can't cache Post.find_by(author: david) ...yet
+        return super unless hash.keys.all? { |k| columns_hash.has_key?(k.to_s) }
+
         key  = hash.keys
 
         klass = self
diff --git a/activerecord/test/cases/finder_test.rb b/activerecord/test/cases/finder_test.rb
index <HASH>..<HASH> 100644
--- a/activerecord/test/cases/finder_test.rb
+++ b/activerecord/test/cases/finder_test.rb
@@ -1073,6 +1073,11 @@ class FinderTest < ActiveRecord::TestCase
     assert_equal nil, Post.find_by("1 = 0")
   end
 
+  test "find_by with associations" do
+    assert_equal authors(:david), Post.find_by(author: authors(:david)).author
+    assert_equal authors(:mary) , Post.find_by(author: authors(:mary) ).author
+  end
+
   test "find_by doesn't have implicit ordering" do
     assert_sql(/^((?!ORDER).)*$/) { Post.find_by(id: posts(:eager_other).id) }
   end
Fix find_by with associations not working with adequate record

For now, we will just skip the cache when a non-column key is used in the hash.
If the future, we can probably move some of the logic in PredicateBuilder.expand
up the chain to make caching possible for association queries.

Closes #<I>
Fixes #<I>