Just like pilots. You can drink and be a pilot, just not 8 hours before. How long you have a high varies wildly, and under stress old highs can come back.
Edit: And if you think you can come up with a combination where you didn't die an hour after your drinks and are still drunk 8 hours later, here is a calculator
There is no test that can determine when someone last had a drink. The results of a blood alcohol test for someone who had a beer 7 hours and 30 minutes ago will be wildly different than those of someone who skipped dinner and crushed a fifth of whiskey 7 hours and 30 minutes ago...
How many doobies does it take to stay high for 8 hours?