title: Ruby on rails: dependent destroy not working with renamed foreign key
body: <p><em>I didn't find any related threads on this, so I made a new question myself.</em>
  I have following models. I added <code>foreign_key: :sender</code> in the class User because the field name <code>:sender</code> of the model class <code>Comment</code> differs from the model class <code>User</code>.
  I added <code>dependent: :destroy</code> to the class <code>User</code> to make sure when an user is deleted all of its comments are deleted as well.
  However when I destroy an user, their comments do not get destroyed. The comments remain in the database. I don't see why.</p>
  
  <pre><code>class Comment &lt; ApplicationRecord
    belongs_to :sender, :class_name =&gt; "User"
    belongs_to :event
  end
  
  class User &lt; ApplicationRecord     
    has_many :comments, dependent: :destroy, foreign_key: :sender
  end
  
  class CommentsController &lt; ApplicationController
  &lt;snip&gt;
  def destroy
      @event = Event.find(params[:event_id]) # dont mind this line
      @comment = Comment.find(params[:id])
      @comment.destroy
      redirect_to event_path(@event) # dont mind this either
    end
  &lt;snip&gt;
  end
  
  class UsersController &lt; ApplicationController
  &lt;snip&gt;
  def destroy
      @user = User.find(params[:id])
      @user.destroy
  
      redirect_to users_path
    end
  &lt;snip&gt;
  end
  </code></pre>