method

find_sole_by

Importance_1
v7.1.3.4 - Show latest stable - 0 notes - Class: ActiveRecord::FinderMethods
find_sole_by(arg, *args) 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.find_sole_by(["price = %?", price])
Show source
Register or log in to add new notes.