Flowdock
method

third_to_last

Importance_1
Ruby on Rails latest stable (v6.1.7.7) - 0 notes - Class: ActiveRecord::FinderMethods
third_to_last() public

Find the third-to-last record. If no order is defined it will order by primary key.

Person.third_to_last # returns the third-to-last object fetched by SELECT * FROM people
Person.offset(3).third_to_last # returns the third-to-last object from OFFSET 3
Person.where(["user_name = :u", { u: user_name }]).third_to_last
Show source
Register or log in to add new notes.