instance method
forty_two
Ruby on Rails 4.1.16
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 245
def forty_two
find_nth(:forty_two, offset_value ? offset_value + 41 : 41)
end
Defined in activerecord/lib/active_record/relation/finder_methods.rb line 245
· View on GitHub
· Improve this page
· Find usages on GitHub
Defined in ActiveRecord::FinderMethods