views:

49

answers:

2

Did to_json get removed or something?

A: 

to_json is part of ActiveRecord::Base

It looks like you might want as_json?

macek
+1  A: 

Try adding require "active_support/core_ext"

require 'active_support' doesn't inject behavior into the core classes by itself. That way you can pick which extensions you want. Using core_ext dumps the extensions you are familiar with from rails into the core classes.

BaroqueBobcat
Ahhh, shoulda known this, similar thing happened recently. This is new in 3.0 though right? This stuff used to work without doing this.
Travis R
I think it was in one of the 2.3.x releases. I saw this behavior with 2.3.9
BaroqueBobcat