Closed mateusnava closed 1 year ago
This is an improvement for this PR.
The idea here is to automatically adds _destroy attribute in the association class when allow_destroy is true.
_destroy
allow_destroy
class Requirement attribute :categories, Category.to_array_type accepts_nested_attributes_for [:categories, { allow_destroy: true }] end
class Category include StoreModel::Model attr_accessor :_destroy end
class Category include StoreModel::Model end
This is an improvement for this PR.
The idea here is to automatically adds
_destroy
attribute in the association class whenallow_destroy
is true.Example
Without this PR
With this PR