James West wrote:
> James West wrote:
> Sorry, I ommited to post the actual error which is now
>
> Cannot modify association 'User#addresses' because the source reflection
> class 'Address' is associated to 'UserRole' via :has_many.
Further investigation shows that the address record seems to have the
correct SQL being generated for it.
I just updated Rails from 2.3.2 to 2.3.3 to see if that made a
difference but this has had no effect.
Processing Admin::UsersController#update (for 127.0.0.1 at 2009-08-08
07:37:27) [PUT]
Parameters: {"user"=>{"name"=>"test2", "public_name"=>"Test 2",
"addresses_attributes"=>{"1249713438151"=>{"city"=>"ccc",
"postcode"=>"ccc", "house"=>"ccc", "town"=>"ccc", "street"=>"ccc"}},
"password_confirmation"=>"", "password"=>""}, "commit"=>"Update",
"authenticity_token"=>"xO3gOpJcO08UGEzEtifnCIKqEOhwtDaz0UkM7X7aAQY=",
"id"=>"1"}
[4;36;1mUser Load (0.0ms) [0m [0;1mSELECT * FROM "users" WHERE
("users"."id" = 1) LIMIT 1 [0m
[4;35;1mTheme Load (0.0ms) [0m [0mSELECT * FROM "themes" WHERE
("themes"."active" = 't') LIMIT 1 [0m
ActiveRecord::HasManyThroughCantAssociateThroughHasManyReflection
(Cannot modify association 'User#addresses' because the source
reflection class 'Address' is associated to 'UserRole' via :has_many.):
app/controllers/admin/users_controller.rb:72:in `update'
app/controllers/admin/users_controller.rb:71:in `update'
C:/Development/InstantRails/ruby/lib/ruby/1.8/webrick/httpserver.rb:104:in
`service'
C:/Development/InstantRails/ruby/lib/ruby/1.8/webrick/httpserver.rb:65:in
`run'
C:/Development/InstantRails/ruby/lib/ruby/1.8/webrick/server.rb:173:in
`start_thread'
C:/Development/InstantRails/ruby/lib/ruby/1.8/webrick/server.rb:162:in
`start'
C:/Development/InstantRails/ruby/lib/ruby/1.8/webrick/server.rb:162:in
`start_thread'
C:/Development/InstantRails/ruby/lib/ruby/1.8/webrick/server.rb:95:in
`start'
C:/Development/InstantRails/ruby/lib/ruby/1.8/webrick/server.rb:92:in
`each'
C:/Development/InstantRails/ruby/lib/ruby/1.8/webrick/server.rb:92:in
`start'
C:/Development/InstantRails/ruby/lib/ruby/1.8/webrick/server.rb:23:in
`start'
C:/Development/InstantRails/ruby/lib/ruby/1.8/webrick/server.rb:82:in
`start'
Rendered rescues/_trace (484.0ms)
Rendered rescues/_request_and_response (0.0ms)
Rendering rescues/layout (internal_server_error)
--
Posted via http://www.ruby-forum.com/.
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Ruby
on Rails: Talk" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/rubyonrails-talk?hl=en
-~----------~----~----~----~------~----~------~--~---