require "active_support"
desc "test"
task :foo => [:environment] do
parse(:categories) do |hash|
# cleanup name
hash[:name] = titlecase(hash[:name])
# ...
end
end
undefined method `titlecase' main:Object
ActiveSupport::Inflector::titlecase(hash[:name])
undefined method `titlecase' ActiveSupport::Inflector:Module
try
hash[:name] = hash[:name].titlecase
instead of what you are trying. it worked for me.