Rails 1.2"服务已被弃用"

San*_*jay 2 ruby-on-rails deprecated

我的应用是在轨道上1.2.6,我想将它升级到2.2我看到在日志中这样的警告:弃用警告:服务已停用,并将从Rails 2.0中被删除,请参阅http://www.rubyonrails.org/deprecation为细节.(从.... application.rb:14调用)

线是问题是服务:通知

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

Gor*_*son 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
Run Code Online (Sandbox Code Playgroud)