Hi, I notice ActiveSupport::Cache implementations behave differently when 
cache key is nil.

cache_key = nil
Rails.cache.write(cache_key, 'value')
Rails.cache.read(cache_key)

For example, FileStore raises a file system error "No such file or 
directory" when calling write() with nil cache key. This error does not 
communicate what actually went wrong (i.e. cache key cannot be nil/empty). 
It's better if a descriptive exception is raised.
Anyway, I'm curious what should be the expected behavior when cache key is 
nil? And whether the expected behavior should be specified in 
ActiveSupport::Cache or in its implementation?

fyi, more details and failing tests are available: 
https://github.com/rails/rails/pull/11009

-- 
You received this message because you are subscribed to the Google Groups "Ruby 
on Rails: Core" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/rubyonrails-core.
For more options, visit https://groups.google.com/groups/opt_out.


Reply via email to