Hi. I've been using Sequel on a work project for a few months now and I created a small extension locally for a `#one` method on Dataset. The idea behind it is to do a LIMIT(2) query and then assert that exactly one result was found and then return that. If 0 results or 2 results are returned, it raises an error. I originally saw this idea in DataMapper or ROM (I don't recall which) and find it very useful. It helps you check the assumptions you've made about your query. Often when using `first!`, what I really want is to know I got back the one and only possible result. It's also useful for killing mutations (we use mutant <https://github.com/mbj/mutant> in our codebase) and I feel like this could benefit others.
I was wondering if you'd be interested in this as a feature and would accept a pull request to add this to Sequel proper or as a packaged extension. Here's a gist <https://gist.github.com/dgollahon/1ca462ed2ed7460f7156940d97bf9f25> of what I'm talking about. Thanks for all your hard work on Sequel! - Daniel -- You received this message because you are subscribed to the Google Groups "sequel-talk" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To post to this group, send email to [email protected]. Visit this group at https://groups.google.com/group/sequel-talk. For more options, visit https://groups.google.com/d/optout.
