instance method
first!
Ruby on Rails 3.2.22.5
Since v3.1.12Signature
first!()
Same as first but raises ActiveRecord::RecordNotFound if no record is found. Note that first! accepts no arguments.
Source
# File activerecord/lib/active_record/relation/finder_methods.rb, line 128
def first!
first or raise RecordNotFound
end
Defined in activerecord/lib/active_record/relation/finder_methods.rb line 128
· View on GitHub
· Improve this page
· Find usages on GitHub
Defined in ActiveRecord::FinderMethods