method
sole
v7.1.3.4 -
Show latest stable
- Class:
ActiveRecord::FinderMethods
sole()public
Finds the sole matching record. Raises ActiveRecord::RecordNotFound if no record is found. Raises ActiveRecord::SoleRecordExceeded if more than one record is found.
Product.where(["price = %?", price]).sole