It's a stupid law made by the clueless and fearmongers. For starters what does it matter if your gun can't be detected, a gun without ammo is just a club/paperweight. And last time I checked there's no non-metal ammo. Then there's the fact that they have more than metal detectors now (I don't know how many times I've had to do the body scan, and I've even gone through a few that could supposedly sense explosives somehow). Or the fact that the law won't stop criminals, or that if one can somehow smuggle in ammo for said "undetectable" gun then they could just as easily smuggle in a gun.
And all of this is without even bringing up the "...shall not be infringed" bit of the 2A and just logical reasons for why the law is so misguided (since apparently a lot of people outside of various gun forums think that quoting the 2A isn't a valid reason).