-
Type: New Feature
-
Resolution: Fixed
-
Priority: Major - P3
-
Affects Version/s: 7.0.0, 7.0.1
-
Component/s: Query
-
Fully Compatible
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.
- causes
-
MONGOID-4830 Remove #one method from has_many associations
- Closed
- related to
-
MONGOID-4470 relations requests causes scanAndOrder queries
- Closed
-
MONGOID-4998 Make all #first and #last methods have consistent signatures and compatible with Ruby core/AR
- Closed