Skip to content

Instantly share code, notes, and snippets.

@pencilcheck
Created March 12, 2012 22:16
Show Gist options
  • Save pencilcheck/2025044 to your computer and use it in GitHub Desktop.
Save pencilcheck/2025044 to your computer and use it in GitHub Desktop.
heroku log
33 respond_to :json¬
34 def update¬
35 @resume = current_user.resumes.find params[:id]¬
36 ¬
37 key = params[:model]¬
38 hash_id = params[key]['hash_id']¬
39 params[key][:start_date] = Time.utc params[key][:start_date][:year], \¬
40 params[key][:start_date][:month] if params[key].has_key? :start_date¬
41 params[key][:end_date] = Time.utc params[key][:end_date][:year], \¬
42 params[key][:end_date][:month] if params[key].has_key? :end_date¬
43 ¬
44 logger.debug params¬
45 ¬
46 @section = @resume.send(key.pluralize).find(:all, :conditions => { :hash_id => h ash_id })¬
47 logger.debug @section¬
48 ¬
49 if @section and not @section.empty?¬
50 logger.debug "update_attributes"¬
51 @section.first.update_attributes params[key]¬
52 else¬
53 logger.debug "create new record"¬
54 @section = @resume.send(key.pluralize).new(params[key])¬
55 logger.debug @section¬
56 if @section.save¬
57 logger.debug 'created successfully'¬
58 render :json => @section¬
59 else¬
60 logger.debug 'created UNsuccessfully'¬
61 render 'edit'¬
62 end¬
63 end¬
64 ¬
65 end¬
2012-03-12T22:06:55+00:00 heroku[router]: GET myordo-testing.herokuapp.com/assets/resumegens/work_experience.js dyno=web.1 queue=0 wait=0ms service=43ms status=304 bytes=0
2012-03-12T22:06:55+00:00 heroku[router]: GET myordo-testing.herokuapp.com/assets/resumegens.js dyno=web.1 queue=0 wait=0ms service=24ms status=304 bytes=0
2012-03-12T22:06:55+00:00 heroku[router]: GET myordo-testing.herokuapp.com/assets/resumegens/work_experience_item.js dyno=web.1 queue=0 wait=0ms service=29ms status=304 bytes=0
2012-03-12T22:06:58+00:00 heroku[router]: GET myordo-testing.herokuapp.com/assets/stripbg.png dyno=web.1 queue=0 wait=0ms service=8ms status=200 bytes=2854
2012-03-12T22:06:58+00:00 heroku[router]: GET myordo-testing.herokuapp.com/assets/logo_cropped.png dyno=web.1 queue=0 wait=0ms service=3ms status=200 bytes=5480
2012-03-12T22:07:01+00:00 heroku[router]: GET myordo-testing.herokuapp.com/assets/bootstrap/glyphicons-halflings.png dyno=web.1 queue=0 wait=0ms service=35ms status=200 bytes=4352
2012-03-12T22:07:09+00:00 app[web.1]:
2012-03-12T22:07:09+00:00 app[web.1]:
2012-03-12T22:07:09+00:00 app[web.1]: Started PUT "/update" for 140.112.233.249 at 2012-03-12 22:07:09 +0000
2012-03-12T22:07:09+00:00 app[web.1]:
2012-03-12T22:07:09+00:00 app[web.1]: app/controllers/resumegens_controller.rb:56:in `update'
2012-03-12T22:07:09+00:00 app[web.1]: NoMethodError (undefined method `order' for #<Education:0x000000071dc9f8>):
2012-03-12T22:07:09+00:00 app[web.1]:
2012-03-12T22:07:09+00:00 app[web.1]:
2012-03-12T22:07:09+00:00 app[web.1]: Processing by ResumegensController#update as JSON
2012-03-12T22:07:09+00:00 app[web.1]: Parameters: {"utf8"=>"✓", "education"=>{"hash_id"=>"ade6afcd3274773978912206fd57ba43efe1e646", "school"=>"123", "degree"=>"321", "location"=>"", "graduate_date"=>{"day"=>"1", "month"=>"1", "year"=>"2007"}, "is_current"=>"false", "placement"=>"0", "title"=>"123"}, "id"=>"1", "user_id"=>"pencilcheck", "model"=>"education"}
2012-03-12T22:07:09+00:00 app[web.1]: {"utf8"=>"✓", "education"=>{"hash_id"=>"ade6afcd3274773978912206fd57ba43efe1e646", "school"=>"123", "degree"=>"321", "location"=>"", "graduate_date"=>{"day"=>"1", "month"=>"1", "year"=>"2007"}, "is_current"=>"false", "placement"=>"0", "title"=>"123"}, "id"=>"1", "user_id"=>"pencilcheck", "model"=>"education", "controller"=>"resumegens", "action"=>"update"}
2012-03-12T22:07:09+00:00 app[web.1]: create new record
2012-03-12T22:07:09+00:00 app[web.1]: []
2012-03-12T22:07:09+00:00 app[web.1]: #<Education:0x000000071dc9f8>
2012-03-12T22:07:09+00:00 app[web.1]: Completed 500 Internal Server Error in 49ms
2012-03-12T22:07:09+00:00 app[web.1]: Rendered vendor/bundle/ruby/1.9.1/gems/actionpack-3.2.1/lib/action_dispatch/middleware/templates/rescues/_trace.erb (6.7ms)
2012-03-12T22:07:09+00:00 app[web.1]: Rendered vendor/bundle/ruby/1.9.1/gems/actionpack-3.2.1/lib/action_dispatch/middleware/templates/rescues/_request_and_response.erb (2.3ms)
2012-03-12T22:07:09+00:00 app[web.1]: Rendered vendor/bundle/ruby/1.9.1/gems/actionpack-3.2.1/lib/action_dispatch/middleware/templates/rescues/diagnostics.erb within rescues/layout (15.4ms)
2012-03-12T22:07:09+00:00 heroku[router]: PUT myordo-testing.herokuapp.com/update dyno=web.1 queue=0 wait=0ms service=150ms status=500 bytes=27228
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment