module ActiveRecord::NestedAttributes

def call_reject_if(association_name, attributes)

Returns false if there is a +destroy_flag+ on the attributes.

The reject_if option is defined by +accepts_nested_attributes_for+.
rejected by calling the reject_if Symbol or Proc (if defined).
Determines if a record with the particular +attributes+ should be
def call_reject_if(association_name, attributes)
  return false if will_be_destroyed?(association_name, attributes)
  case callback = nested_attributes_options[association_name][:reject_if]
  when Symbol
    method(callback).arity == 0 ? send(callback) : send(callback, attributes)
  when Proc
    callback.call(attributes)
  end
end