Open dmrAnderson opened 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.
required_attributes
{ 'id' => 1, '_destroy' => 'FAKE', price: '' }
record
database
price
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 arecord
in thedatabase
where theprice
is missing.