instance method
second_to_last!
Ruby on Rails 7.0.10
Since v5.2.8.1Signature
second_to_last!()
Same as #second_to_last but raises ActiveRecord::RecordNotFound if no record is found.
Source
# File activerecord/lib/active_record/relation/finder_methods.rb, line 294
def second_to_last!
second_to_last || raise_record_not_found_exception!
end
Defined in activerecord/lib/active_record/relation/finder_methods.rb line 294
· View on GitHub
· Improve this page
· Find usages on GitHub
Defined in ActiveRecord::FinderMethods