Method: Oj::Rails.mimic_JSON
- Defined in:
- ext/oj/rails.c
.mimic_JSON ⇒ Object
Sets the JSON method to use Oj similar to Oj.mimic_JSON except with the ActiveSupport monkey patches instead of the json gem monkey patches.
798 799 800 801 802 803 804 805 806 807 808 809 810 811 812 |
# File 'ext/oj/rails.c', line 798 VALUE rails_mimic_json(VALUE self) { VALUE json; if (rb_const_defined_at(rb_cObject, rb_intern("JSON"))) { json = rb_const_get_at(rb_cObject, rb_intern("JSON")); } else { json = rb_define_module("JSON"); } oj_mimic_json_methods(json); // Setting the default mode breaks the prmoise in the docs not to. // oj_default_options.mode = RailsMode; return Qnil; } |