Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我想在 Cells 中使用 Rails 自己的控制器基准测试方法。include ActiveSupport::Benchmarkable我在单元控制器中尝试过。但是调用self.class.benchmark会给出“不存在方法”错误。
include ActiveSupport::Benchmarkable
self.class.benchmark
我发现我可以调用self.benchmark(实例方法),这与 Rails 不同,它是类方法。
self.benchmark