instance method
forty_two
Ruby on Rails 8.0.4
Since v4.1.16Signature
forty_two()
Find the forty-second record. Also known as accessing “the reddit”. If no order is defined it will order by primary key.
Person.forty_two # returns the forty-second object fetched by SELECT * FROM people Person.offset(3).forty_two # returns the forty-second object from OFFSET 3 (which is OFFSET 44) Person.where(["user_name = :u", { u: user_name }]).forty_two
Source
# File activerecord/lib/active_record/relation/finder_methods.rb, line 287
def forty_two
find_nth 41
end
Defined in activerecord/lib/active_record/relation/finder_methods.rb line 287
· View on GitHub
· Improve this page
· Find usages on GitHub
Defined in ActiveRecord::FinderMethods