Move cache table existence check in method

It used to require a database connection during assets:precompile, which prevents deployment to Heroku