Ups.
Tom, forget my last exception. I was placing :accessible => true also
in thes belongs_to associations.
I now have only :accessible => true in the has_many that do not have
through.
The exception is:
Processing ChampionshipMembershipsController#create (for 127.0.0.1 at
2008-12-08 21:15:17) [POST]
Parameters: {"page_path"=>"championships/show",
"authenticity_token"=>"d04a3cc34d67201b4345424fecedc30c716b69d2",
"render"=>{"0"=>{"id"=>"members",
"part_context"=>"BAhbCDoMbWVtYmVycyIaY2hhbXBpb25zaGlwOjgyNzcxMDk4WwA=--018c9358d91d0c4092a459e31c4345734083a661\n"},
"1"=>{"id"=>"games",
"part_context"=>"BAhbCDoKZ2FtZXMiGmNoYW1waW9uc2hpcDo4Mjc3MTA5OFsA--2cd299c5ae1777b89010f0a744861562c24e9526\n"}},
"championship_membership"=>{"user"=>"admin",
"championship_id"=>"82771098"}}
[4;35;1mUser Load (0.0ms) [0m [0mSELECT * FROM "users" WHERE
("users"."id" = 541702176) [0m
ActiveRecord::AssociationTypeMismatch (User expected, got String):
/vendor/plugins/hobo/hobo/lib/active_record/association_proxy.rb:
20:in `raise_on_type_mismatch'
c:/ruby/lib/ruby/gems/1.8/gems/activerecord-2.2.2/lib/
active_record/associations/belongs_to_association.rb:22:in `replace'
c:/ruby/lib/ruby/gems/1.8/gems/activerecord-2.2.2/lib/
active_record/associations.rb:1276:in `user='
c:/ruby/lib/ruby/gems/1.8/gems/activerecord-2.2.2/lib/
active_record/base.rb:2587:in `send'
c:/ruby/lib/ruby/gems/1.8/gems/activerecord-2.2.2/lib/
active_record/base.rb:2587:in
`attributes_without_hobo_type_conversion='
c:/ruby/lib/ruby/gems/1.8/gems/activerecord-2.2.2/lib/
active_record/base.rb:2583:in `each'
c:/ruby/lib/ruby/gems/1.8/gems/activerecord-2.2.2/lib/
active_record/base.rb:2583:in
`attributes_without_hobo_type_conversion='
/vendor/plugins/hobo/hobo/lib/hobo/model.rb:430:in `send'
/vendor/plugins/hobo/hobo/lib/hobo/model.rb:430:in `attributes='
/vendor/plugins/hobo/hobo/lib/hobo/permissions.rb:162:in
`user_update_attributes'
/vendor/plugins/hobo/hobo/lib/hobo/permissions.rb:139:in
`with_acting_user'
/vendor/plugins/hobo/hobo/lib/hobo/permissions.rb:161:in
`user_update_attributes'
/vendor/plugins/hobo/hobo/lib/hobo/model_controller.rb:494:in
`hobo_create'
/vendor/plugins/hobo/hobo/lib/hobo/model_controller.rb:156:in
`create'
c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.2.2/lib/
action_controller/base.rb:1253:in `send'
c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.2.2/lib/
action_controller/base.rb:1253:in `perform_action_without_filters'
c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.2.2/lib/
action_controller/filters.rb:617:in `call_filters'
c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.2.2/lib/
action_controller/filters.rb:638:in `run_before_filters'
/vendor/plugins/hobo/hobo/lib/hobo/controller.rb:22:in `call'
/vendor/plugins/hobo/hobo/lib/hobo/controller.rb:22:in
`included_in_class'
c:/ruby/lib/ruby/gems/1.8/gems/activesupport-2.2.2/lib/
active_support/callbacks.rb:182:in `call'
c:/ruby/lib/ruby/gems/1.8/gems/activesupport-2.2.2/lib/
active_support/callbacks.rb:182:in `evaluate_method'
c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.2.2/lib/
action_controller/filters.rb:184:in `call'
c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.2.2/lib/
action_controller/filters.rb:635:in `run_before_filters'
c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.2.2/lib/
action_controller/filters.rb:615:in `call_filters'
c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.2.2/lib/
action_controller/filters.rb:610:in `perform_action_without_benchmark'
c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.2.2/lib/
action_controller/benchmarking.rb:68:in
`perform_action_without_rescue'
c:/ruby/lib/ruby/1.8/benchmark.rb:293:in `measure'
c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.2.2/lib/
action_controller/benchmarking.rb:68:in
`perform_action_without_rescue'
c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.2.2/lib/
action_controller/rescue.rb:136:in `perform_action_without_caching'
c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.2.2/lib/
action_controller/caching/sql_cache.rb:13:in `perform_action'
c:/ruby/lib/ruby/gems/1.8/gems/activerecord-2.2.2/lib/
active_record/connection_adapters/abstract/query_cache.rb:34:in
`cache'
c:/ruby/lib/ruby/gems/1.8/gems/activerecord-2.2.2/lib/
active_record/query_cache.rb:8:in `cache'
c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.2.2/lib/
action_controller/caching/sql_cache.rb:12:in `perform_action'
c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.2.2/lib/
action_controller/base.rb:524:in `send'
c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.2.2/lib/
action_controller/base.rb:524:in `process_without_filters'
c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.2.2/lib/
action_controller/filters.rb:606:in
`process_without_session_management_support'
c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.2.2/lib/
action_controller/session_management.rb:134:in `process'
c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.2.2/lib/
action_controller/base.rb:392:in `process'
c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.2.2/lib/
action_controller/dispatcher.rb:183:in `handle_request'
c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.2.2/lib/
action_controller/dispatcher.rb:110:in `dispatch_unlocked'
c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.2.2/lib/
action_controller/dispatcher.rb:123:in `dispatch'
c:/ruby/lib/ruby/1.8/thread.rb:135:in `synchronize'
c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.2.2/lib/
action_controller/dispatcher.rb:122:in `dispatch'
c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.2.2/lib/
action_controller/dispatcher.rb:132:in `dispatch_cgi'
c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.2.2/lib/
action_controller/dispatcher.rb:39:in `dispatch'
c:/ruby/lib/ruby/gems/1.8/gems/rails-2.2.2/lib/webrick_server.rb:
103:in `handle_dispatch'
c:/ruby/lib/ruby/gems/1.8/gems/rails-2.2.2/lib/webrick_server.rb:
74:in `service'
c:/ruby/lib/ruby/1.8/webrick/httpserver.rb:104:in `service'
c:/ruby/lib/ruby/1.8/webrick/httpserver.rb:65:in `run'
c:/ruby/lib/ruby/1.8/webrick/server.rb:173:in `start_thread'
c:/ruby/lib/ruby/1.8/webrick/server.rb:162:in `start'
c:/ruby/lib/ruby/1.8/webrick/server.rb:162:in `start_thread'
c:/ruby/lib/ruby/1.8/webrick/server.rb:95:in `start'
c:/ruby/lib/ruby/1.8/webrick/server.rb:92:in `each'
c:/ruby/lib/ruby/1.8/webrick/server.rb:92:in `start'
c:/ruby/lib/ruby/1.8/webrick/server.rb:23:in `start'
c:/ruby/lib/ruby/1.8/webrick/server.rb:82:in `start'
c:/ruby/lib/ruby/gems/1.8/gems/rails-2.2.2/lib/webrick_server.rb:
60:in `dispatch'
c:/ruby/lib/ruby/gems/1.8/gems/rails-2.2.2/lib/commands/servers/
webrick.rb:66
c:/ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:in
`gem_original_require'
c:/ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:in
`require'
c:/ruby/lib/ruby/gems/1.8/gems/activesupport-2.2.2/lib/
active_support/dependencies.rb:153:in `require'
c:/ruby/lib/ruby/gems/1.8/gems/activesupport-2.2.2/lib/
active_support/dependencies.rb:521:in `new_constants_in'
c:/ruby/lib/ruby/gems/1.8/gems/activesupport-2.2.2/lib/
active_support/dependencies.rb:153:in `require'
c:/ruby/lib/ruby/gems/1.8/gems/rails-2.2.2/lib/commands/server.rb:
49
c:/ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:in
`gem_original_require'
c:/ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:in
`require'
./script/server:3
-e:2:in `load'
-e:2
Rendered c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.2.2/lib/
action_controller/templates/rescues/_trace (78.0ms)
Rendered c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.2.2/lib/
action_controller/templates/rescues/_request_and_response (0.0ms)
Rendering c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.2.2/lib/
action_controller/templates/rescues/layout.erb (internal_server_error)
TF
On Dec 8, 9:13 pm, GamaFranco <[EMAIL PROTECTED]> wrote:
> David,
>
> Have you managed to have the issue fixed? Again, I may be doing
> something wrong.
>
> TF
>
> On Dec 8, 9:12 pm, GamaFranco <[EMAIL PROTECTED]> wrote:
>
> > Just updated the hobo's edge version.
>
> > Added :accessible all has_many except the ones with :through.
>
> > NoMethodError (You have a nil object when you didn't expect it!
> > The error occurred while evaluating nil.member_class):
> > /vendor/plugins/hobo/hobo/lib/hobo/accessible_associations.rb:
> > 58:in `find_record'
> > /vendor/plugins/hobo/hobo/lib/hobo/accessible_associations.rb:
> > 21:in `find_or_create_and_update'
> > /vendor/plugins/hobo/hobo/lib/hobo/accessible_associations.rb:
> > 106:in `user='
> > c:/ruby/lib/ruby/gems/1.8/gems/activerecord-2.2.2/lib/
> > active_record/base.rb:2587:in `send'
> > c:/ruby/lib/ruby/gems/1.8/gems/activerecord-2.2.2/lib/
> > active_record/base.rb:2587:in
> > `attributes_without_hobo_type_conversion='
> > c:/ruby/lib/ruby/gems/1.8/gems/activerecord-2.2.2/lib/
> > active_record/base.rb:2583:in `each'
> > c:/ruby/lib/ruby/gems/1.8/gems/activerecord-2.2.2/lib/
> > active_record/base.rb:2583:in
> > `attributes_without_hobo_type_conversion='
> > /vendor/plugins/hobo/hobo/lib/hobo/model.rb:430:in `send'
> > /vendor/plugins/hobo/hobo/lib/hobo/model.rb:430:in `attributes='
> > /vendor/plugins/hobo/hobo/lib/hobo/permissions.rb:162:in
> > `user_update_attributes'
> > /vendor/plugins/hobo/hobo/lib/hobo/permissions.rb:139:in
> > `with_acting_user'
> > /vendor/plugins/hobo/hobo/lib/hobo/permissions.rb:161:in
> > `user_update_attributes'
> > /vendor/plugins/hobo/hobo/lib/hobo/model_controller.rb:494:in
> > `hobo_create'
> > /vendor/plugins/hobo/hobo/lib/hobo/model_controller.rb:156:in
> > `create'
> > c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.2.2/lib/
> > action_controller/base.rb:1253:in `send'
> > c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.2.2/lib/
> > action_controller/base.rb:1253:in `perform_action_without_filters'
> > c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.2.2/lib/
> > action_controller/filters.rb:617:in `call_filters'
> > c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.2.2/lib/
> > action_controller/filters.rb:638:in `run_before_filters'
> > /vendor/plugins/hobo/hobo/lib/hobo/controller.rb:22:in `call'
> > /vendor/plugins/hobo/hobo/lib/hobo/controller.rb:22:in
> > `included_in_class'
> > c:/ruby/lib/ruby/gems/1.8/gems/activesupport-2.2.2/lib/
> > active_support/callbacks.rb:182:in `call'
> > c:/ruby/lib/ruby/gems/1.8/gems/activesupport-2.2.2/lib/
> > active_support/callbacks.rb:182:in `evaluate_method'
> > c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.2.2/lib/
> > action_controller/filters.rb:184:in `call'
> > c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.2.2/lib/
> > action_controller/filters.rb:635:in `run_before_filters'
> > c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.2.2/lib/
> > action_controller/filters.rb:615:in `call_filters'
> > c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.2.2/lib/
> > action_controller/filters.rb:610:in `perform_action_without_benchmark'
> > c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.2.2/lib/
> > action_controller/benchmarking.rb:68:in
> > `perform_action_without_rescue'
> > c:/ruby/lib/ruby/1.8/benchmark.rb:293:in `measure'
> > c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.2.2/lib/
> > action_controller/benchmarking.rb:68:in
> > `perform_action_without_rescue'
> > c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.2.2/lib/
> > action_controller/rescue.rb:136:in `perform_action_without_caching'
> > c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.2.2/lib/
> > action_controller/caching/sql_cache.rb:13:in `perform_action'
> > c:/ruby/lib/ruby/gems/1.8/gems/activerecord-2.2.2/lib/
> > active_record/connection_adapters/abstract/query_cache.rb:34:in
> > `cache'
> > c:/ruby/lib/ruby/gems/1.8/gems/activerecord-2.2.2/lib/
> > active_record/query_cache.rb:8:in `cache'
> > c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.2.2/lib/
> > action_controller/caching/sql_cache.rb:12:in `perform_action'
> > c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.2.2/lib/
> > action_controller/base.rb:524:in `send'
> > c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.2.2/lib/
> > action_controller/base.rb:524:in `process_without_filters'
> > c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.2.2/lib/
> > action_controller/filters.rb:606:in
> > `process_without_session_management_support'
> > c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.2.2/lib/
> > action_controller/session_management.rb:134:in `process'
> > c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.2.2/lib/
> > action_controller/base.rb:392:in `process'
> > c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.2.2/lib/
> > action_controller/dispatcher.rb:183:in `handle_request'
> > c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.2.2/lib/
> > action_controller/dispatcher.rb:110:in `dispatch_unlocked'
> > c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.2.2/lib/
> > action_controller/dispatcher.rb:123:in `dispatch'
> > c:/ruby/lib/ruby/1.8/thread.rb:135:in `synchronize'
> > c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.2.2/lib/
> > action_controller/dispatcher.rb:122:in `dispatch'
> > c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.2.2/lib/
> > action_controller/dispatcher.rb:132:in `dispatch_cgi'
> > c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.2.2/lib/
> > action_controller/dispatcher.rb:39:in `dispatch'
> > c:/ruby/lib/ruby/gems/1.8/gems/rails-2.2.2/lib/webrick_server.rb:
> > 103:in `handle_dispatch'
> > c:/ruby/lib/ruby/gems/1.8/gems/rails-2.2.2/lib/webrick_server.rb:
> > 74:in `service'
> > c:/ruby/lib/ruby/1.8/webrick/httpserver.rb:104:in `service'
> > c:/ruby/lib/ruby/1.8/webrick/httpserver.rb:65:in `run'
> > c:/ruby/lib/ruby/1.8/webrick/server.rb:173:in `start_thread'
> > c:/ruby/lib/ruby/1.8/webrick/server.rb:162:in `start'
> > c:/ruby/lib/ruby/1.8/webrick/server.rb:162:in `start_thread'
> > c:/ruby/lib/ruby/1.8/webrick/server.rb:95:in `start'
> > c:/ruby/lib/ruby/1.8/webrick/server.rb:92:in `each'
> > c:/ruby/lib/ruby/1.8/webrick/server.rb:92:in `start'
> > c:/ruby/lib/ruby/1.8/webrick/server.rb:23:in `start'
> > c:/ruby/lib/ruby/1.8/webrick/server.rb:82:in `start'
> > c:/ruby/lib/ruby/gems/1.8/gems/rails-2.2.2/lib/webrick_server.rb:
> > 60:in `dispatch'
> > c:/ruby/lib/ruby/gems/1.8/gems/rails-2.2.2/lib/commands/servers/
> > webrick.rb:66
> > c:/ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:in
> > `gem_original_require'
> > c:/ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:in
> > `require'
> > c:/ruby/lib/ruby/gems/1.8/gems/activesupport-2.2.2/lib/
> > active_support/dependencies.rb:153:in `require'
> > c:/ruby/lib/ruby/gems/1.8/gems/activesupport-2.2.2/lib/
> > active_support/dependencies.rb:521:in `new_constants_in'
> > c:/ruby/lib/ruby/gems/1.8/gems/activesupport-2.2.2/lib/
> > active_support/dependencies.rb:153:in `require'
> > c:/ruby/lib/ruby/gems/1.8/gems/rails-2.2.2/lib/commands/server.rb:
> > 49
> > c:/ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:in
> > `gem_original_require'
> > c:/ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:in
> > `require'
> > ./script/server:3
> > -e:2:in `load'
> > -e:2
>
> > Rendered c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.2.2/lib/
> > action_controller/templates/rescues/_trace (78.0ms)
> > Rendered c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.2.2/lib/
> > action_controller/templates/rescues/_request_and_response (16.0ms)
> > Rendering c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.2.2/lib/
> > action_controller/templates/rescues/layout.erb (internal_server_error)
>
> > On Dec 8, 9:05 pm, Tom Locke <[EMAIL PROTECTED]> wrote:
>
> > > > I'm having the same problem. Unless I'm doing something
> > > > wrong, :accessible => true didn't fix it.
>
> > > Note that, depending what you're doing, the :accessible => true should
> > > probably be on the has_many, not the has_many :through.
>
> > > Let me know how that works out :)
>
> > > Tom
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Hobo
Users" 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/hobousers?hl=en
-~----------~----~----~----~------~----~------~--~---