title: Rails Associations with Modules
body: <p>With Rails 4.1 I can't seem to get my rails associations to work when using modules.</p>
  
  <p>I have Objects within the FG module:</p>
  
  <pre><code>module FG
    class Object &lt; ActiveRecord::Base
      belongs_to :user
  
      has_one :email
      has_one :phone
    end
  end
  </code></pre>
  
  <p>And Emails in the global space:</p>
  
  <pre><code>class Email &lt; ActiveRecord::Base
    belongs_to :object, class_name: 'FG::Object'
    has_many :objects, class_name: 'FG::Object'
  end
  </code></pre>
  
  <p>When I try</p>
  
  <pre><code>email.objects &lt;&lt; object
  </code></pre>
  
  <p>I get the following error:</p>
  
  <p>ActiveModel::MissingAttributeError
  can't write unknown attribute `object_id'</p>
  
  <p>Am I missing something in the  association setup?</p>