Method: ActiveRecord::FinderMethods#first!
- Defined in:
- activerecord/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.
183 184 185 |
# File 'activerecord/lib/active_record/relation/finder_methods.rb', line 183 def first! first || raise_record_not_found_exception! end |