Skip to content

Instantly share code, notes, and snippets.

@brandoncordell
Created May 2, 2013 20:27
Show Gist options
  • Save brandoncordell/5505138 to your computer and use it in GitHub Desktop.
Save brandoncordell/5505138 to your computer and use it in GitHub Desktop.
Problem destroying nested attributes
Started POST "/patients/4/prescribe" for 127.0.0.1 at 2013-05-02 16:24:39 -0400
Processing by PatientsController#prescribe as HTML
Parameters: {"utf8"=>"✓", "authenticity_token"=>"Y8q2s/H4QzKVX8v03mXKg282kLEaNIwsztwVjQaJL7Q=", "patient"=>{"prescriptions_attributes"=>{"0"=>{"product_id"=>"2", "total_amount_prescribed"=>"100", "total_amount_prescribed_quantity"=>"Tablets", "amount_prescribed"=>"1", "amount_prescribed_quantity"=>"Tablets", "frequency"=>"Daily", "_destroy"=>"1", "id"=>"3"}, "1"=>{"product_id"=>"", "total_amount_prescribed"=>"", "total_amount_prescribed_quantity"=>"", "amount_prescribed"=>"", "amount_prescribed_quantity"=>"", "frequency"=>"", "_destroy"=>"0"}}}, "commit"=>"Update Patient", "patient_id"=>"4"}
User Load (0.1ms) SELECT "users".* FROM "users" WHERE "users"."id" = ? LIMIT 1 [["id", 1]]
{"utf8"=>"✓", "authenticity_token"=>"Y8q2s/H4QzKVX8v03mXKg282kLEaNIwsztwVjQaJL7Q=", "patient"=>{"prescriptions_attributes"=>{"0"=>{"product_id"=>"2", "total_amount_prescribed"=>"100", "total_amount_prescribed_quantity"=>"Tablets", "amount_prescribed"=>"1", "amount_prescribed_quantity"=>"Tablets", "frequency"=>"Daily", "_destroy"=>"1", "id"=>"3"}, "1"=>{"product_id"=>"", "total_amount_prescribed"=>"", "total_amount_prescribed_quantity"=>"", "amount_prescribed"=>"", "amount_prescribed_quantity"=>"", "frequency"=>"", "_destroy"=>"0"}}}, "commit"=>"Update Patient", "action"=>"prescribe", "controller"=>"patients", "patient_id"=>"4"}
Patient Load (0.1ms) SELECT "patients".* FROM "patients" WHERE "patients"."id" = ? AND ("patients"."deleted_at" IS NULL) LIMIT 1 [["id", "4"]]
Prescription Load (0.2ms) SELECT "prescriptions".* FROM "prescriptions" WHERE "prescriptions"."patient_id" = 4 AND "prescriptions"."id" IN (3)
Prescription Load (0.1ms) SELECT "prescriptions".* FROM "prescriptions" WHERE "prescriptions"."patient_id" = 4
prescription #1
#<Prescription:0x007f841182b878>
marked for destruction?: true
prescription #2
#<Prescription:0x007f8411829780>
marked for destruction?: false
 (0.0ms) begin transaction
 (0.0ms) rollback transaction
Redirected to http://localhost:3000/patients
Completed 302 Found in 11ms (ActiveRecord: 0.6ms)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment