class
PgORM::Error::RecordNotFound
- PgORM::Error::RecordNotFound
- PgORM::Error
- Exception
- Reference
- Object
Overview
Raised when a record cannot be found in the database.
Example
User.find(999999) # Raises RecordNotFound
User.find!(999999) # Raises RecordNotFound
User.find_by(email: "[email protected]") # Raises RecordNotFound
Use the ? variants to return nil instead:
User.find?(999999) # => nil
User.find_by?(email: "[email protected]") # => nil