Skip to content

Instantly share code, notes, and snippets.

@cbrumelle
Created July 13, 2010 01:00
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save cbrumelle/473302 to your computer and use it in GitHub Desktop.
Save cbrumelle/473302 to your computer and use it in GitHub Desktop.
Add 'to_json' method to Sequel datasets
# Monkey patch/hack for adding in a to_json for Sequel datasets
# See http://sequel.rubyforge.org
class Sequel::Dataset
def to_json
naked.all.to_json #Note: 'naked' converts dataset to plain hash...
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment