Patch for caching columns for has_and_belongs_to_many

I submitted a patch to lighthouse which caches columns ("SHOW FIELDS")
for has_and_belongs_to_many associations. See the patch and ticket

The patch is simple and unobtrusive, and resulted in a 25% performance
increase (response time, CPU load, and database load all dropped by
about 25%) in my companies Rails app ( which
serves over 500 websites for sports teams.

Further details are at

If someone could take a look at this patch that would be great,