Skip to content

Instantly share code, notes, and snippets.

@gmoore
Created November 29, 2010 19:56
Show Gist options
  • Save gmoore/720502 to your computer and use it in GitHub Desktop.
Save gmoore/720502 to your computer and use it in GitHub Desktop.
Role(#2172144680) expected, got NilClass(#2148295560)
Rails.root: /Users/gary/dev/artful.ly
Application Trace | Framework Trace | Full Trace
app/models/user.rb:24:in `to_producer'
app/controllers/user_roles_controller.rb:24:in `create'
Request
Parameters:
{"commit"=>"Submit",
"user_role"=>{"athena_credit_card"=>{"expiration_date"=>Thu,
01 Nov 2012,
"cvv"=>"928",
"card_number"=>"4111111111111111",
"cardholder_name"=>"Joe Producer"},
"athena_customer"=>{"last_name"=>"Karr",
"phone"=>"5712417836",
"first_name"=>"Justin",
"email"=>"gary.moore@fracturedatlas.org"},
"organization"=>{"name"=>"Frakshured Atlaz"}},
"authenticity_token"=>"L7/cJdp6DfA0rfsng74E7JsFdyd0wmHiHlQXy2iUJYk=",
"utf8"=>"✓"}
Started POST "/user_roles" for 127.0.0.1 at Mon Nov 29 14:53:48 -0500 2010
Processing by UserRolesController#create as HTML
Parameters: {"commit"=>"Submit", "user_role"=>{"athena_credit_card"=>{"cvv"=>"928", "card_number"=>"4111111111111111", "cardholder_name"=>"Joe Producer", "expiration_date(1i)"=>"2012", "expiration_date(2i)"=>"11", "expiration_date(3i)"=>"1"}, "athena_customer"=>{"last_name"=>"Karr", "phone"=>"5712417836", "first_name"=>"Justin", "email"=>"gary.moore@fracturedatlas.org"}, "organization"=>{"name"=>"Frakshured Atlaz"}}, "authenticity_token"=>"L7/cJdp6DfA0rfsng74E7JsFdyd0wmHiHlQXy2iUJYk=", "utf8"=>"✓"}
User Load (0.3ms) SELECT "users".* FROM "users" WHERE ("users"."id" = 5) LIMIT 1
SQL (0.3ms) UPDATE "users" SET "customer_id" = 549033, "updated_at" = '2010-11-29 19:53:50.972473' WHERE ("users"."id" = 5)
User Load (0.3ms) SELECT "users"."id" FROM "users" WHERE (LOWER("users"."email") = LOWER('foo3@fracturedatlas.org')) AND ("users".id <> 5) LIMIT 1
Role Load (7.9ms) SELECT "roles".* FROM "roles" WHERE ("roles"."name" = 'producer') LIMIT 1
Completed in 2516ms
ActiveRecord::AssociationTypeMismatch (Role(#2172144680) expected, got NilClass(#2148295560)):
app/models/user.rb:24:in `to_producer'
app/controllers/user_roles_controller.rb:24:in `create'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment