title: Rails has_one association expected Model got String
body: <p>Having the following associations between 3 models:</p>
  
  <p><b>workout.rb</b></p>
  
  <pre><code>class Workout &lt; ActiveRecord::Base
    has_and_belongs_to_many :workout_sets, :join_table =&gt; :workout_sessions
    belongs_to :warmup, :class_name =&gt; :WorkoutStep, :foreign_key =&gt; "workout_step_id"
    accepts_nested_attributes_for :workout_sets, allow_destroy: true
    accepts_nested_attributes_for :warmup, allow_destroy: true
  end
  </code></pre>
  
  <p><b>workout_set.rb</b></p>
  
  <pre><code>class WorkoutSet &lt; ActiveRecord::Base
    has_and_belongs_to_many :workout_steps, :join_table =&gt; :sets_steps, dependent: :destroy
    has_and_belongs_to_many :workouts, :join_table =&gt; :workout_sessions
    accepts_nested_attributes_for :workout_steps, allow_destroy: true
  
    has_one :intro_video_usage, class_name: 'VideoUsage::Intro', as: :parent, dependent: :destroy
    has_one :intro_video, through: :intro_video_usage, source: :video
  
    accepts_nested_attributes_for :intro_video
  
    has_one :get_ready_video_usage, class_name: 'VideoUsage::GetReady', as: :parent, dependent: :destroy
    has_one :get_ready_video, through: :get_ready_video_usage, source: :video
  
    has_one :congrats_video_usage, class_name: 'VideoUsage::Congratulations', as: :parent, dependent: :destroy
    has_one :congrats_video, through: :congrats_video_usage, source: :video
  end
  </code></pre>
  
  <p>and</p>
  
  <p><b>workout_step.rb</b></p>
  
  <pre><code>class WorkoutStep &lt; ActiveRecord::Base
    has_and_belongs_to_many :workout_sets, :join_table =&gt; :sets_steps
    has_many :main_video_usage, class_name: 'VideoUsage::Main', as: :parent
    has_many :main_videos, through: :main_video_usage, source: :video
    accepts_nested_attributes_for :main_videos
  end
  </code></pre>
  
  <p>And using <a href="https://github.com/plataformatec/simple_form" rel="nofollow">simple_form</a> and <a href="https://github.com/nathanvda/cocoon" rel="nofollow">cocoon</a> to handle nested models creation on the top level model (<code>Workout</code>) I'm having troubles building the form for <code>sets</code> and <code>steps</code> - more concise, when associating a <code>workout_set</code> with an <code>intro_video</code> (and whitelisting the params) I'm having the following error:</p>
  
  <blockquote>
    <p>Video(#70285207226600) expected, got String(#70285080848240)</p>
  </blockquote>
  
  <p>The <code>params</code> object after sending looks like this:</p>
  
  <pre><code>"workout"=&gt;{"title"=&gt;"",
   "workout_sets_attributes"=&gt;{"0"=&gt;{"_destroy"=&gt;"false",
   "intro_video"=&gt;"70",
   "title"=&gt;""}}},
   "image"=&gt;"",
   "sound_logo"=&gt;"",
   "intro_video"=&gt;"",
   "commit"=&gt;"Create workout"}
  </code></pre>
  
  <p>Thanks in advance.</p>