How to handle: reject_if if new record, not update

I am working on some forms that include image upload. There are standard two forms for adding and all forms connected with it. It will look like this:

enter image description here

I have an asset class that is polymorphic for other classes (e.g. locations, elements). The problem is that items can be downloaded or updated. For items and locations, I have the following:

accepts_nested_attributes_for :assets, :allow_destroy => true, :reject_if => lambda { |a| a[:asset].blank? } 

but it seems to reject if there is no file uploaded. This, in essence, is what we want if it is a new file, but there are cases when we simply update the description with the resource identifier. Above: reject_if will reject this script. How can I make an exception to update this other type of information?

THX

+3
1

, params[:id] reject_if. :

accepts_nested_attributes_for :assets, :allow_destroy => true, 
    :reject_if => lambda { |a| a[:asset].blank? && a[:id].blank? }

id , , asset ( id).

+2