Any association that you want to be updated via a form now needs

   :accessible => true

in the model

e.g.  has_many :animals, :accessible => true

Tom

On 8 Dec 2008, at 19:49, davidh wrote:

>
> I upgraded my app to Hobo 0.8.4 and ran into one problem.  I'm using
> autocomplete to edit has-many-through associations.  The autocompleter
> fills in the text boxes on the forms correctly, but when I save I get
> exceptions like the one below.  Is anyone else having similar
> problems?
>
> ActiveRecord::AssociationTypeMismatch in
> AssignmentsController#create_for_contact
> Animal expected, got String
> vendor/plugins/hobo/hobo/lib/active_record/association_proxy.rb:20:in
> `raise_on_type_mismatch'
> c:/program files/ruby/lib/ruby/gems/1.8/gems/activerecord-2.2.2/lib/
> active_record/associations/belongs_to_association.rb:22:in `replace'
> c:/program files/ruby/lib/ruby/gems/1.8/gems/activerecord-2.2.2/lib/
> active_record/associations.rb:1276:in `animal='
> c:/program files/ruby/lib/ruby/gems/1.8/gems/activerecord-2.2.2/lib/
> active_record/base.rb:2587:in `send'
> c:/program files/ruby/lib/ruby/gems/1.8/gems/activerecord-2.2.2/lib/
> active_record/base.rb:2587:in
> `attributes_without_hobo_type_conversion='
> c:/program files/ruby/lib/ruby/gems/1.8/gems/activerecord-2.2.2/lib/
> active_record/base.rb:2583:in `each'
> c:/program files/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:503:in
> `hobo_create_for'
> vendor/plugins/hobo/hobo/lib/hobo/model_controller.rb:273:in
> `create_for_contact'
> c:/program files/ruby/lib/ruby/gems/1.8/gems/actionpack-2.2.2/lib/
> action_controller/base.rb:1253:in `send'
> c:/program files/ruby/lib/ruby/gems/1.8/gems/actionpack-2.2.2/lib/
> action_controller/base.rb:1253:in `perform_action_without_filters'
> c:/program files/ruby/lib/ruby/gems/1.8/gems/actionpack-2.2.2/lib/
> action_controller/filters.rb:617:in `call_filters'
> c:/program files/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:/program files/ruby/lib/ruby/gems/1.8/gems/activesupport-2.2.2/lib/
> active_support/callbacks.rb:182:in `call'
> c:/program files/ruby/lib/ruby/gems/1.8/gems/activesupport-2.2.2/lib/
> active_support/callbacks.rb:182:in `evaluate_method'
> c:/program files/ruby/lib/ruby/gems/1.8/gems/actionpack-2.2.2/lib/
> action_controller/filters.rb:184:in `call'
> c:/program files/ruby/lib/ruby/gems/1.8/gems/actionpack-2.2.2/lib/
> action_controller/filters.rb:635:in `run_before_filters'
> c:/program files/ruby/lib/ruby/gems/1.8/gems/actionpack-2.2.2/lib/
> action_controller/filters.rb:615:in `call_filters'
> ...
>
> >


--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---

Reply via email to