最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

Arbitrary Class: Uninitialized Constant Error with string.classify.constantize Rails 7 - Stack Overflow

programmeradmin5浏览0评论

I'm upgrading a rails app from 5.1 to 7.1.5.1. I have the app working well except for the following issue.

When I try to run

pdf_class = "my_arbitrary_class"
pdf_class.classify.constantize

I get an error of NameError (uninitialized constant MyArbitraryClass):

I have been doing minor / major upgrades the whole way through and only see this issue when I get to Rails 7. I assume there is a change to the code somewhere between 6 and 7 but I can't find any documentation on this specific issue.

I'm running:

  • Ruby: 3.2.2
  • Rails: 7.1.5.1

Any help on this would be great.

发布评论

评论列表(0)

  1. 暂无评论