Refactor the way how we check if compilation of assets is necessary (ruby)