src code

instance method ActiveRecord.Model#toJSON

ActiveRecord.Model#toJSON([object_to_inject]) → String

Serializes the record to an JSON string. If object_to_inject is passed that object will override any values of the record.