instance method
last!
Ruby on Rails 5.0.7.2
Since v3.1.12Signature
last!()
Same as #last but raises ActiveRecord::RecordNotFound if no record is found. Note that #last! accepts no arguments.
Source
# File activerecord/lib/active_record/relation/finder_methods.rb, line 167
def last!
last or raise RecordNotFound.new("Couldn't find #{@klass.name} with [#{arel.where_sql(@klass.arel_engine)}]")
end
Defined in activerecord/lib/active_record/relation/finder_methods.rb line 167
· View on GitHub
· Improve this page
· Find usages on GitHub
Defined in ActiveRecord::FinderMethods