a clone of "http://rubygems.org/gems/constant_cache", to provide this nice functionality on rails 4 and above