APIdock / Ruby on Rails
/
Browse About
method

second_to_last!

v7.1.3.2 - Show latest stable - Class: ActiveRecord::FinderMethods
second_to_last!()
public

Same as #second_to_last but raises ActiveRecord::RecordNotFound if no record is found.

# File activerecord/lib/active_record/relation/finder_methods.rb, line 317
    def second_to_last!
      second_to_last || raise_record_not_found_exception!
    end

Related methods

  • Instance methods
  • exists?
  • fifth
  • fifth!
  • find
  • find_by
  • find_by!
  • find_sole_by
  • first
  • first!
  • forty_two
  • forty_two!
  • fourth
  • fourth!
  • include?
  • last
  • last!
  • member?
  • raise_record_not_found_exception!
  • second
  • second!
  • second_to_last
  • second_to_last!
  • sole
  • take
  • take!
  • third
  • third!
  • third_to_last
  • third_to_last!
  • Private methods
  • private_order_columns
  • privateapply_join_dependency
  • privateconstruct_relation_for_exists
  • privatefind_last
  • privatefind_nth
  • privatefind_nth_from_last
  • privatefind_nth_with_limit
  • privatefind_one
  • privatefind_some
  • privatefind_some_ordered
  • privatefind_take
  • privatefind_take_with_limit
  • privatefind_with_ids
  • privateordered_relation
  • privateusing_limitable_reflections?
APIdock API Documentation Browser

© 2026 APIdock