instance method
third
Ruby on Rails 5.2.8.1
Since v4.1.16Signature
third()
Find the third record. If no order is defined it will order by primary key.
Person.third # returns the third object fetched by SELECT * FROM people Person.offset(3).third # returns the third object from OFFSET 3 (which is OFFSET 5) Person.where(["user_name = :u", { u: user_name }]).third
Source
# File activerecord/lib/active_record/relation/finder_methods.rb, line 187
def third
find_nth 2
end
Defined in activerecord/lib/active_record/relation/finder_methods.rb line 187
· View on GitHub
· Improve this page
· Find usages on GitHub
Defined in ActiveRecord::FinderMethods