title: activerecord shovel operator <<
body: <p>From inside edit action in the contacts controller have ...</p>
  
  <pre><code>@programs &lt;&lt; @contact.program
  </code></pre>
  
  <p>Which produces the following error:  </p>
  
  <pre class="lang-none prettyprint-override"><code>NoMethodError - undefined method `&lt;&lt;' for Program::ActiveRecord_Relation
  </code></pre>
  
  <p>Contacts Model:</p>
  
  <pre><code>belongs_to :program
  </code></pre>
  
  <p>Program Model:</p>
  
  <pre><code>has_many :contacts
  validates :name, presence: true, uniqueness: true
  
  @programs.class
  Program::ActiveRecord_Relation
  
  @contact.program.class
  Program(id: integer, name: string, active: boolean, created_at: datetime, updated_at: datetime)
  </code></pre>
  
  <p>Question: Why does this operation fail?  Why can't the record get added to the record collection.  What is preventing the collection(ActiveRecord_Relation) from adding the record?</p>