How it works - `belongs_to :user, dependent: :destroy`
<p>I know how to work <code>has_many :posts, dependent: :destroy</code>. If <code>User</code> or something that <code>has_many</code> posts is destroyed, all belonging posts are also destroyed.</p>

<p>But what happens when <code>Post</code> model <code>belongs_to :user, dependent: :destroy</code>?
I found the option in Rails Guide, but I couldn't find out how to work it.</p>

<p><a href="http://guides.rubyonrails.org/association_basics.html" rel="noreferrer">http://guides.rubyonrails.org/association_basics.html</a></p>