File: //usr/local/rvm/gems/default/doc/activerecord-6.1.4.1/ri/ActiveRecord/FinderMethods/last-i.ri
U:RDoc::AnyMethod[iI" last:ETI"%ActiveRecord::FinderMethods#last;TF:publico:RDoc::Markup::Document:@parts[o:RDoc::Markup::Paragraph; [I"JFind the last record (or last N records if a parameter is supplied). ;TI"9If no order is defined it will order by primary key.;To:RDoc::Markup::BlankLine o:RDoc::Markup::Verbatim; [ I"KPerson.last # returns the last object fetched by SELECT * FROM people
;TI"5Person.where(["user_name = ?", user_name]).last
;TI"4Person.order("created_on DESC").offset(5).last
;TI"VPerson.last(3) # returns the last three objects fetched by SELECT * FROM people.
;T:@format0o;
; [I"QTake note that in that last case, the results are sorted in ascending order:;T@o;; [I"6[#<Person id:2>, #<Person id:3>, #<Person id:4>]
;T;
0o;
; [I"
and not:;T@o;; [I"5[#<Person id:4>, #<Person id:3>, #<Person id:2>];T;
0:
@fileI"1lib/active_record/relation/finder_methods.rb;T:0@omit_headings_from_table_of_contents_below000[ I"(limit = nil);T@"FI"FinderMethods;TcRDoc::NormalModule00