Guest User

Untitled

a guest
May 24th, 2018
84
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.67 KB | None | 0 0
  1. # i have the following scaffolded create method in my controller. i've
  2. # changed nothing since it was generated by scaffold.
  3.  
  4. # POST /log_item
  5. # POST /log_item.xml
  6. def create
  7. @log_item = LogItem.new(params[:log_item])
  8.  
  9. respond_to do |format|
  10. if @log_item.save
  11. flash[:notice] = 'LogItem was successfully created.'
  12. format.html { redirect_to(@log_item) }
  13. format.xml { render :xml => @log_item, :status => :created, :location => @log_item }
  14. else
  15. format.html { render :action => "new" }
  16. format.xml { render :xml => @log_item.errors, :status => :unprocessable_entity }
  17. end
  18. end
  19. end
  20.  
  21.  
  22. # and you would think that the first command in the method would go through assigning all the
  23. # parameter values:
  24.  
  25. #Processing LogItemsController#create (for 127.0.0.1 at 2008-10-09 12:38:44) [POST]
  26. # Session ID: BAh7BzoJdXNlcmkCYSciCmZsYXNoSUM6J0FjdGlvbkNvbnRyb2xsZXI6OkZs
  27. #YXNoOjpGbGFzaEhhc2h7AAY6CkB1c2VkewA=--b50d8bb86feb6b6043307e1ff458b6dafecb2e17
  28. # Parameters: {"promo_vid"=>"501859", "log_id"=>"257732", "action"=>"create", "controller"=>"log_items", "break_id"=>"1480726", "start_time"=>"2008-10-12 9:36:16 AM", "item_type"=>"PROM"}
  29.  
  30. # However, none of those parameter values seem to be getting assigned:
  31.  
  32. # ActiveRecord::StatementInvalid (OCIError: ORA-01400: cannot insert NULL into ("LOG"."LOG_ITEM"."LOG_ID"): INSERT INTO "LOG_ITEM" (recorded_media_content_id, promo_vid, log_item_id, log_id, contingency_seq, video_guide, break_id, actual_start_time, bug, item_type, play_id, start_time, actual_airtime, hd_bug) VALUES(NULL, NULL, 15424820, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL))
Add Comment
Please, Sign In to add comment