title: Object expected, got ActiveSupport::HashWithIndifferentAccess Nested form
body: <p>I am getting this error haven't seen it before, have tried all the solutions to the similar questions here, I am trying to select a council where a tenant lives from a pre-populated council model, using through council history, the form shows up however when I press submit I keep getting this error. Appreciate any help with this problem. </p>
  
  <pre><code>Started PUT "/properties/6/build/council" for 127.0.0.1 at 2013-08-18 22:32:55 +0100
  Processing by Properties::BuildController#update as HTML
    Parameters: {"utf8"=&gt;"✓",    "authenticity_token"=&gt;"wBWQaxtBioqzGLkhUrstqS+cFD/xvEutXnJ0jWNtSa0=", "property"=&gt;   {"council_history"=&gt;{"id"=&gt;"1"}}, "commit"=&gt;"Save Property[council history]",  "property_id"=&gt;"6", "id"=&gt;"council"}
    Property Load (0.3ms)  SELECT "properties".* FROM "properties" WHERE "properties"."id" =   ? LIMIT 1  [["id", "6"]]
     (0.1ms)  begin transaction
     (  0.1ms)  rollback transaction
   Completed 500 Internal Server Error in 62ms
   ActiveRecord::AssociationTypeMismatch - CouncilHistory(#70308444526760) expected, got          ActiveSupport::HashWithIndifferentAccess(#70308443935640):
  activerecord (3.2.13) lib/active_record/associations/association.rb:204:in `raise_on_type_mismatch'
    activerecord (3.2.13) lib/active_record/associations/has_one_association.rb:8:in `replace'
    activerecord (3.2.13) lib/active_record/associations/singular_association.rb:17:in `writer'
    activerecord (3.2.13) lib/active_record/associations/builder/association.rb:51:in `block in define_writers'
    activerecord (3.2.13) lib/active_record/attribute_assignment.rb:94:in `block in assign_attributes'
    activerecord (3.2.13) lib/active_record/attribute_assignment.rb:93:in `assign_attributes'
    activerecord (3.2.13) lib/active_record/persistence.rb:216:in `block in update_attributes'
    activerecord (3.2.13) lib/active_record/transactions.rb:313:in `block in with_transaction_returning_status'
    activerecord (3.2.13)    lib/active_record/connection_adapters/abstract/database_statements.rb:192:in `transaction'
    activerecord (3.2.13) lib/active_record/transactions.rb:208:in `transaction'
    activerecord (3.2.13) lib/active_record/transactions.rb:311:in `with_transaction_returning_status'
    activerecord (3.2.13) lib/active_record/persistence.rb:215:in `update_attributes'
    app/controllers/properties/build_controller.rb:23:in `update'
  </code></pre>
  
  <p>Property Model</p>
  
  <pre><code>class Property &lt; ActiveRecord::Base
    attr_accessible  :name, :address_attributes, :tenants_attributes, :meter_attributes,  :council_history, :council_history_attributes, :property_id, :council_id, :status
    belongs_to :user 
  
    has_one :council_history
    accepts_nested_attributes_for :council_history
  
    has_one :council, through: :council_history
    accepts_nested_attributes_for :council
  
  end
  </code></pre>
  
  <p>Council Model</p>
  
  <pre><code>class Council &lt; ActiveRecord::Base
    attr_accessible :CouncilEmail, :name, :CouncilTel
  
    has_many   :council_history
  
    has_many   :properties, :through =&gt; :council_history 
  end
  </code></pre>
  
  <p>Council History Model</p>
  
  <pre><code> class CouncilHistory &lt; ActiveRecord::Base
    attr_accessible :council_id, :property_id, :vacant 
  
    belongs_to :council
  
    belongs_to :property
  
   end
  </code></pre>
  
  <p>Select Council View Form</p>
  
  <pre><code>&lt;h1&gt;Select Council&lt;/h1&gt;
  
  
  
  &lt;%= simple_form_for @property, :url =&gt; url_for(:action =&gt; 'update', :controller =&gt;   'properties/build'), :method =&gt; 'put' do |f| %&gt;
    &lt;%= f.simple_fields_for :council_history do |builder| %&gt;
    &lt;%= builder.input :id, :collection =&gt; Council.all %&gt;
    &lt;%= builder.submit %&gt;
   &lt;% end %&gt;
  &lt;% end %&gt;
  </code></pre>
  
  <p>Build Property Controller</p>
  
  <pre><code>class Properties::BuildController &lt; ApplicationController
    include Wicked::Wizard
  
     steps :tenant, :meter, :council, :confirmed 
  
    def show
      @property = Property.find(params[:property_id])
      @tenants = @property.tenants.new(params[:tenant_id])
      @meter = @property.build_meter
      @council = @property.build_council_history
      render_wizard
    end
  
    def edit
      @property = Property.find(params[:property_id])
    end
  
  
    def update
      @property = Property.find(params[:property_id])
      params[:property][:status] = step.to_s
      params[:property][:status] = 'active' if step == steps.last
      @property.update_attributes(params[:property])
      render_wizard @property
    end
  end
  </code></pre>