Skip to content

Instantly share code, notes, and snippets.

@catwell
Created January 25, 2012 18:27
Show Gist options
  • Save catwell/1677748 to your computer and use it in GitHub Desktop.
Save catwell/1677748 to your computer and use it in GitHub Desktop.
ActiveSupport Black Magic
[~ 19:35] irb -r'active_support/core_ext'
ruby-1.9.2-p136 :001 > "x".as_json
NoMethodError: undefined method `as_json' for "x":String
from (irb):1
from /Users/pierre/.rvm/rubies/ruby-1.9.2-p136/bin/irb:16:in `<main>'
ruby-1.9.2-p136 :002 > "y".to_json
=> ""y""
ruby-1.9.2-p136 :003 > "x".as_json
=> "x"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment