views:

120

answers:

1

My app is on rails 1.2.6 and I wish to upgrade it to 2.2 I see this warning in the logs: DEPRECATION WARNING: service is deprecated and will be removed from Rails 2.0 See http://www.rubyonrails.org/deprecation for details. (called from .... application.rb:14)

The line is question is service :notification

Can somebody tell me what service does as I can't find any documentation on this.

+6  A: 

service was a way of specifying controller dependencies. Dependency loading got moved into ActiveSupport.

From the 1.2.0 code:

  # 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
Gordon Wilson
So I simply remove this line and it will work or do I need to do something extra?
Sanjay
I believe just removing it will work. But I can't make any promises w/o seeing more of your code.
Gordon Wilson