guard against nil @associations_pot
Bring PR #355 from @sonnym in the rails-4 branch into master.
This commit is contained in:
parent
a0032d766d
commit
1fd76da42b
|
@ -174,7 +174,7 @@ module Ransack
|
||||||
|
|
||||||
found_association = list.detect do |assoc|
|
found_association = list.detect do |assoc|
|
||||||
assoc.reflection.name == name &&
|
assoc.reflection.name == name &&
|
||||||
@associations_pot[assoc] == parent &&
|
(@associations_pot.nil? || @associations_pot[assoc] == parent) &&
|
||||||
(!klass || assoc.reflection.klass == klass)
|
(!klass || assoc.reflection.klass == klass)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue