method

first_or_last

rails latest stable - Class: ActiveRecord::Associations::CollectionAssociation

Method deprecated or moved

This method is deprecated or moved on the latest stable version. The last existing version (v4.0.2) is shown here.

first_or_last(type, *args)
private

Fetches the first/last using SQL if possible, otherwise from the target array.