Uploaded image for project: 'Mongoid'
  1. Mongoid
  2. MONGOID-2914

Can you specify a sort/order when using .includes(...)

    • Type: Icon: Task Task
    • Resolution: Done
    • 12_01_17
    • Affects Version/s: None
    • Component/s: None
    • Labels:
      None

      We're loading additional documents with something like Post.includes(:comments).

      We'd like to control the order the comments get loaded, so when we do {{post.comments.each

      {|c| ... }

      }} they are in the right order.

      Is this possible without adding a default_scope on the collection? Thanks!

            Assignee:
            Unassigned Unassigned
            Reporter:
            barmstrong Brian Armstrong
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved: