I am trying to get reject_if to work using a method name instead of a Proc. However I cannot seem to get this to work. A simplified version of my model code is shown below. The problem is that I keep getting an "undefined method `call' for :not_wired?:Symbol" error. I am using Rails 2.3.4. Can anyone give me an idea of what might be going on here?
class DeviceConfiguration < ActiveRecord::Base
has_one :obd_configuration accepts_nested_attributes_for :obd_configuration, :reject_if => :not_obd?
has_one :wired_configuration accepts_nested_attributes_for :wired_configuration, :reject_if => :not_wired?
def not_obd?(attrs) !device_type.name.eql?("obd") end
def not_wired?(attrs) !device_type.name.eql?("wired") end
end