OrestF / readymade

MIT License
9 stars 4 forks source link

The form can skip validation for required attributes and doesn't remove the record if ':_destroy' attribute is present #24

Open dmrAnderson opened 2 months ago

dmrAnderson commented 2 months ago

https://github.com/OrestF/readymade/blob/cfd569eecb80c7231f53d9036b8110bb78a9d06f/lib/readymade/form.rb#L48 This solution can not cover all values from Active Model Boolean Type

nestedattributes ': destroy' flag checker

So, I can skip validation for required_attributes if someone sends { 'id' => 1, '_destroy' => 'FAKE', price: '' }. Ultimately, I'll have a record in the database where the price is missing.