Unsuccessful safe constantize

suggest change

This example will not work because the string passed in isn’t recognized as a constant in the project. Even if you pass in "array", it won’t work as it isn’t capitalized.

my_string = "not_a_constant" 
  # => 'not_a_constant'
my_string.safe_constantize
  # => nil

my_string = "array" #Not capitalized!
  # => 'array'
my_string.safe_constantize
  # => nil

Feedback about page:

Feedback:
Optional: your email if you want me to get back to you:


Safe constantize:
*Unsuccessful safe constantize

Table Of Contents
22Safe constantize
55CSV