Method: ActiveRecord::FinderMethods#first!

Defined in:
lib/active_record/relation/finder_methods.rb

#first!Object

Same as first but raises ActiveRecord::RecordNotFound if no record is found. Note that first! accepts no arguments.



97
98
99
# File 'lib/active_record/relation/finder_methods.rb', line 97

def first!
  first or raise RecordNotFound
end