Update Gemfile
guard against nil @associations_pot

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