Feature Request: Get first/last of scope
klementtan opened this issue · 2 comments
klementtan commented
I would like to make a feature request for a function for a parent object to return the first/last children. The parent object has children that implements act_as_list with the parent as its scope.
brendon commented
Hi @klementtan, if you're looking for a way to store inheritance information, check out the ancestry
gem. This gem works well with acts_as_list
.
As far as getting the first or last item within a scope, that comes with ActiveRecord
; you can call first
and last
on a scoped relation to get the appropriate record.
klementtan commented
Understood thanks!