2

我的应用程序在 Rails 1.2.6 上,我希望将其升级到 2.2 我在日志中看到此警告:弃用警告:服务已弃用,将从 Rails 2.0 中删除,请参阅http://www.rubyonrails.org/deprecation细节。(从 .... application.rb:14 调用)

该行是问题是服务:通知

有人可以告诉我什么服务,因为我找不到任何关于此的文档。

4

1 回答 1

6

service是一种指定控制器依赖关系的方法。依赖加载已移至 ActiveSupport。

从 1.2.0 代码:

  # Specifies a variable number of services that this controller depends on. 
  # Services are normally singletons or factories, like
  # Action Mailer service or a Payment Gateway service.
  def service(*services)
    require_dependencies(:service, services)
    depend_on(:service, services)
  end
  deprecate :service
于 2009-01-08T02:19:10.423 回答