Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- def remove_records!
- remove_ids = @document_attribute_params["document_attribute_options_attributes"].select{|x| x["_destroy"] == true }.map{|x| x["id"].to_i }
- return unless remove_ids.present?
- DocumentAttributeOption.where(id: remove_ids).destroy_all
- @document_attribute_params["document_attribute_options_attributes"].reject!{|x| x["_destroy"]}
- end
- fix remove and create mismatch
Advertisement
Add Comment
Please, Sign In to add comment