title: Undesired behavior when preloading and ordering a has_many :through association
body: <p>If we have 3 schemas: ChatRoom, User, and Message</p>
  <pre><code>ChatRoom.ex
  schema &quot;chat_rooms&quot; do
    has_many(:users, User)
    has_many(:messages, through: [:users, :messages])
  end
  </code></pre>
  <p>Is there an established way with Ecto to &quot;Get a chat room, and all of the messages of associated users sorted by some field on the message&quot;?</p>
  <p>I originally was trying to simply get a chatroom and <code>preload</code> it with all of its messages sorted by <code>message.inserted_at</code>, and was ok with having it do that in two queries (and understand how to do that in a single query combining <code>join</code> and <code>preload</code>), but when it comes time to sort by a value on the has_many :through resource, it seems to apply that same sort to the middle association (in this example, user).</p>
  <p>Example issue: So if ChatRoom A has two users in it (user1 joined first, user2 joined second), and we had the message sequence of:</p>
  <ul>
  <li>user1: &quot;hi&quot;</li>
  <li>user2: &quot;hello&quot;</li>
  <li>user1: &quot;goodbye&quot;</li>
  <li>user2: &quot;farewell&quot;</li>
  </ul>
  <p>If I did:</p>
  <pre><code>sorted_message_query = from(message in Message, order_by: message.inserted_at)
  
  from(chat_room in ChatRoom,
    where: chat_room.id == ^chat_room_id,
    preload: [messages: ^sorted_message_query]
  )
  </code></pre>
  <p>The <code>messages</code> result on the <code>chat_room</code> would actually be listed like:</p>
  <ol>
  <li>user1's &quot;hi&quot;</li>
  <li>user1's &quot;goodbye&quot;</li>
  <li>user2's &quot;hello&quot;</li>
  <li>user2's &quot;farewell&quot;</li>
  </ol>
  <p>which is clearly not the goal. How do you sort a preloaded query in Ecto without having that apply to the join resource?</p>