accepts_nested_attributes_for wrong number of arguments (1 for 0)

I have a problem with has_many relationship and nested attributes

class WorkOrder < ActiveRecord::Base
  has_many :services,:order=> :row,:dependent => :destroy
  belongs_to :car
  belongs_to :company
  belongs_to :service_offer
  belongs_to :user_rank, :class_name => 'Rank',:foreign_key =>
  belongs_to :company_rank,:class_name =>'Rank', :foreign_key =>

  accepts_nested_attributes_for :services

class Service < ActiveRecord::Base
  has_many :material_services, :order =>:row
  belongs_to :service_type
  belongs_to :work_order
  acts_as_list :scope=> "work_order_id",:column=>:row
  has_and_belongs_to_many :tasks
  attr :rows_id,true

  accepts_nested_attributes_for :material_services


class MaterialService < ActiveRecord::Base
  belongs_to :service
  acts_as_list :scope=> "service_id" ,:column=>:row
  belongs_to :material_service_type

  accepts_nested_attributes_for :material_service_type


I have WorkOrder that has_many Services and Services has_many
MaterialServices...but I get an error when try to create a services
through WorkOrder

wo =
that throw wrong number of arguments (1 for 0)

but if I run
s =
ms =
That works perfect... I tried to debug the ActiveRercord but was
imposible for me :slight_smile:
I just can't see what I have different between WorkOrder and Service
relationship and Service and MaterialServices.

Any help is very usefull