Closed vladfaust closed 6 years ago
repo.query(User.where(id: 42)).first? vs repo.query_one?(User.where(id: 42))
repo.query(User.where(id: 42)).first?
repo.query_one?(User.where(id: 42))
This underscore is ugly. It may also confuse with an idea that _one somehow affects the query (e.g. automatically limiting it to 1), which is false.
_one
I like the first approach repo.query(User.where(id: 42)).first? :+1: more OOP and intuitive
Closed by 226b92c3ff82403e52a719369569e68a88a6b814
repo.query(User.where(id: 42)).first?
vsrepo.query_one?(User.where(id: 42))
This underscore is ugly. It may also confuse with an idea that
_one
somehow affects the query (e.g. automatically limiting it to 1), which is false.