title: build methods for has_one though has_one
body: <p>Rails 5.1.2
  Ruby 2.5.3</p>
  
  <p>I understand there are multiple ways to impliment this relationship, however, this question is more about why the following doesn't work rather than solving a real world problem.</p>
  
  <p><strong><code>has_many</code> setup</strong></p>
  
  <pre><code>class Subscriber &lt; ApplicationRecord
    has_many :subscriptions, inverse_of: :subscriber
    has_many :promotions, through: :subscriptions, inverse_of: :subscriptions
  
    accepts_nested_attributes_for :subscriptions
    accepts_nested_attributes_for :promotions
  end
  
  class Subscription &lt; ApplicationRecord
    belongs_to :subscriber, inverse_of: :subscriptions
    belongs_to :promotion, inverse_of: :subscriptions
  end
  
  class Promotion &lt; ApplicationRecord
    has_many :subscriptions, inverse_of: :promotion
    has_many :subscribers, through: :subscriptions, inverse_of: :subscriptions
  
    accepts_nested_attributes_for :subscriptions
    accepts_nested_attributes_for :subscribers
  end
  </code></pre>
  
  <p>In the above <code>Subscriber</code> model which is setup to use <code>has_many</code> relationships following would work:</p>
  
  <pre><code>s = Subscriber.new
  s.subscriptions.build
  # OR
  s.promotions.build
  </code></pre>
  
  <p>Following that, I would expect <code>Subscriber</code> to behave the same way with <code>has_one</code> relationships</p>
  
  <p><strong><code>has_one</code> setup</strong></p>
  
  <pre><code>class Subscriber &lt; ApplicationRecord
    has_one :subscription, inverse_of: :subscriber
    has_one :promotion, through: :subscription, inverse_of: :subscriptions
  
    accepts_nested_attributes_for :subscription
    accepts_nested_attributes_for :promotion
  end
  
  class Subscription &lt; ApplicationRecord
    belongs_to :subscriber, inverse_of: :subscription
    belongs_to :promotion, inverse_of: :subscriptions
  end
  
  class Promotion &lt; ApplicationRecord
    has_many :subscriptions, inverse_of: :promotion
    has_many :subscribers, through: :subscriptions, inverse_of: :subscription
  
    accepts_nested_attributes_for :subscriptions
    accepts_nested_attributes_for :subscribers
  end
  </code></pre>
  
  <p>However, attempting to build the nested <code>promotion</code> association with the equivalent <code>has_one</code> build methods results in a <code>NoMethodError (undefined method 'build_promotion' for #&lt;Subscriber:0x00007f9042cbd7c8&gt;)</code> error</p>
  
  <pre><code>s = Subscriber.new
  s.build_promotion
  </code></pre>
  
  <p>However, this does work:</p>
  
  <pre><code>s = Subscriber.new
  s.build_subscription
  </code></pre>
  
  <p>I feel it's logical that one should expect to build nested <code>has_one</code> relationships in the same way one builds <code>has_many</code>. </p>
  
  <p>Is this a bug or by design?</p>