guard against nil @associations_pot
guard against nil @associations_pot

Bring PR #355 from @sonnym in the rails-4 branch into master.

amboxer21/ransack,nagyt234/ransack,guilleva/ransack,Eric-Guo/ransack,laserlemon/ransack,avit/ransack,praktijkindex/ransack,outstand/ransack,martndemus/ransack,Mario245/ransack,roman-franko/ransack,vaski/ransack,activerecord-hackery/ransack,johan--/ransack,mariorcardoso/ransack,reinteractive/ransack,AndrewSwerlick/ransack