You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When passing a symbol with underscores (e.g. :my_things) to the _cache_keys_for_all_ method in app/helpers/cache_helper.rb, such as in the following line:
localized_cache cache_keys_for_all(:my_things) do
it throws the following error:
LoadError - Unable to autoload constant My_thing
due to the code in line 9 of the file, which appears in the _cache_key_for_all_ method, called by the _cache_keys_for_all_ method:
9: klass = klass_name.to_s.singularize.capitalize.constantize
Using the example of :my_things, this line will try to set klass to "My_thing", triggering the error when it attempts to constantize.
I believe it should be:
9: klass = klass_name.to_s.singularize.camelize.constantize
which would set klass to "MyThing", which seems to be the correct form.
The text was updated successfully, but these errors were encountered:
When passing a symbol with underscores (e.g. :my_things) to the _cache_keys_for_all_ method in app/helpers/cache_helper.rb, such as in the following line:
localized_cache cache_keys_for_all(:my_things) do
it throws the following error:
LoadError - Unable to autoload constant My_thing
due to the code in line 9 of the file, which appears in the _cache_key_for_all_ method, called by the _cache_keys_for_all_ method:
9: klass = klass_name.to_s.singularize.capitalize.constantize
Using the example of :my_things, this line will try to set klass to "My_thing", triggering the error when it attempts to constantize.
I believe it should be:
9: klass = klass_name.to_s.singularize.camelize.constantize
which would set klass to "MyThing", which seems to be the correct form.
The text was updated successfully, but these errors were encountered: