Skip to content

Instantly share code, notes, and snippets.

@thejefflarson
Created January 23, 2013 19:53
Show Gist options
  • Save thejefflarson/4612259 to your computer and use it in GitHub Desktop.
Save thejefflarson/4612259 to your computer and use it in GitHub Desktop.
def as_json(opts = {})
ret = super(opts)
ret.reduce({}) do |memo, kv|
memo[kv.first] = kv.last if kv.last
memo
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment