Use detect instead of select + first to avoid an intermediate array.

Additionally, the intent is more obvious by removing the extra block.

Other examples of more concise use of enumerable are listed here:
https://github.com/tcopeland/pippi
Merge pull request #1144 from jrafanie/use_detect

Use detect instead of select + first to avoid an intermediate array.