Skip to content

Instantly share code, notes, and snippets.

View cyberfox's full-sized avatar

Morgan Schweers cyberfox

View GitHub Profile
require 'rubygems'
require 'sqlite3'
require 'sequel'
# Adding this monkey-patch makes it work on MacRuby.
module Sequel
class Dataset
def single_record
record = nil
clone(:limit=>1).each{|r| record = r; return r}