Comment Comment by house9-2 Rails 7 has finally added this to active record: sole and find_sole_byBoth raise an exception unless a single record is found.Of course this would not make a difference when working with mongoid... I also like the fail fast approach.https://blog.saeloun.com/2021/03/16/rails-adds-sole-and-find... parent house9-2 4 years ago
Both raise an exception unless a single record is found.
Of course this would not make a difference when working with mongoid... I also like the fail fast approach.
https://blog.saeloun.com/2021/03/16/rails-adds-sole-and-find...