Do not try to preload Commits when using Note.includes(:noteable)

This commit is contained in:
Douwe Maan 2017-05-31 11:12:21 -05:00
parent e53169c970
commit 257f4eaa97
2 changed files with 15 additions and 0 deletions

View File

@ -0,0 +1,15 @@
module ActiveRecord
module Associations
class Preloader
module NoCommitPreloader
def preloader_for(reflection, owners, rhs_klass)
return NullPreloader if rhs_klass == ::Commit
super
end
end
prepend NoCommitPreloader
end
end
end