guard against nil @associations_pot

Bring PR #355 from @sonnym in the rails-4 branch into master.
This commit is contained in:
Jon Atack 2014-04-22 19:32:02 +02:00
parent a0032d766d
commit 1fd76da42b
1 changed files with 1 additions and 1 deletions

View File

@ -174,7 +174,7 @@ module Ransack
found_association = list.detect do |assoc|
assoc.reflection.name == name &&
@associations_pot[assoc] == parent &&
(@associations_pot.nil? || @associations_pot[assoc] == parent) &&
(!klass || assoc.reflection.klass == klass)
end