Implement #take / #take! for AR feature parity

XMLWordPrintableJSON

    • Type: New Feature
    • Resolution: Fixed
    • Priority: Major - P3
    • 8.0.1, 7.5.0
    • Affects Version/s: 7.0.0, 7.0.1
    • Component/s: Query
    • Fully Compatible
    • None
    • None
    • None
    • None
    • None
    • None

      In https://jira.mongodb.org/browse/MONGOID-4470 users have asked that we add a shorthand for getting an arbitrary instance of a model from the database. Per https://api.rubyonrails.org/classes/ActiveRecord/FinderMethods.html#method-i-take, the method should be called #take/#take!.

      Additional methods defined by AR (#second, #third, #fourth, #second_to_last) may also be implemented.

      When this is done, id_sort arguments to #first and #last should be deprecated.

            Assignee:
            Neil Shweky (Inactive)
            Reporter:
            Oleg Pudeyev (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: