Rails gem upgrade: unsafe query risk in ActiveRecord