refs #CNVS-26056
Change-Id: I4a4d91c8f96a9d86646bdd14ba9ed75e365a9764
Reviewed-on: https://gerrit.instructure.com/69227
Tested-by: Jenkins
Reviewed-by: Cody Cutrer <cody@instructure.com>
Product-Review: James Williams <jamesw@instructure.com>
QA-Review: James Williams <jamesw@instructure.com>
Some of these tweaks to bin and config were made just to match what a
newly-generated rails4 project looks like.
Change-Id: I57a7c71e2ddd7f3295ffadf30cb0976c4d15db6a
Reviewed-on: https://gerrit.instructure.com/41186
Reviewed-by: Cody Cutrer <cody@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
Product-Review: Brian Palmer <brianp@instructure.com>
QA-Review: Brian Palmer <brianp@instructure.com>
rails3 changed BigDecimal json serialization to return a string, but this breaks
bw-compat with our existing apis. rails4 provides an option to opt-out of this,
so opt-out if we can, but otherwise monkey-patch rails3 to use native behavior
Change-Id: I50796ed1d2d33aa1ab9fce576016b5b08b24b30c
Reviewed-on: https://gerrit.instructure.com/30858
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Derek DeVries <ddevries@instructure.com>
Product-Review: Derek DeVries <ddevries@instructure.com>
QA-Review: Derek DeVries <ddevries@instructure.com>
closes CNVS-9074
In rails2, we explicitly override `render :json` to use Oj and the
ParamsParser middleware to parse with Oj.
In rails3, we enable the oj backend for ActiveSupport::JSON. However,
sadly that's not enough because of the screwy state of JSON in Rails 3
and Rails 4.0.x. So we pull in the rails-patch-json-encode gem to fix
performance. If this ends up causing issues as we continue working
toward Rails 3.2, we'll remove this gem. A good explantion of the issues
is in the README: https://github.com/GoodLife/rails-patch-json-encode
In my local (rails2) benchmarking, json response generation is 12-14x faster
*with stringify ids* enabled. It'll be slightly faster without, but
stringify is becoming the norm. json parsing is a smaller win, 2-3x
faster, but still significant enough to warrant patching ParamsParser
(said patch goes away in rails3).
test plan:
* no behavior changes are expected
* regression testing of the api, both the json responses and sending
json to put/post requests
* regression testing of the web ui in areas that use the api and ajax
calls
Change-Id: I632549baaa4e51dd0ee67dede911941877911102
Reviewed-on: https://gerrit.instructure.com/25458
Reviewed-by: Brian Palmer <brianp@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
QA-Review: August Thornton <august@instructure.com>
Product-Review: Brian Palmer <brianp@instructure.com>
fixes CNVS-7597
when given this header, data structures passed to render :json are
pre-processed before serialization to json such that any integer values
in 'id', 'foo_id', or 'foo_ids' fields (also 'ids' fields, but we don't
have any of those currently that I'm aware off), at any level (e.g.
within a nested data structure), are cast to strings.
test-plan:
- full regression testing of both the UI (as it makes API calls) and
the documented API
- no UI behavior should change
- API behavior should change only as described above
Change-Id: I4e0a68957038be063cf488dd9ec2262452dea3cf
Reviewed-on: https://gerrit.instructure.com/23956
Reviewed-by: Jacob Fugal <jacob@instructure.com>
Product-Review: Jacob Fugal <jacob@instructure.com>
QA-Review: Jacob Fugal <jacob@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
refs CNVS-7597
to go along with the existing to_json overrides
test-plan: N/A
Change-Id: I56d4b558465e2c06f3d87c75c63335e4df912e17
Reviewed-on: https://gerrit.instructure.com/23875
Reviewed-by: Jacob Fugal <jacob@instructure.com>
Product-Review: Jacob Fugal <jacob@instructure.com>
QA-Review: Jacob Fugal <jacob@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
this is equivalent to our custom addition to do this escaping (though it
also escapes amperstands, which ours didn't)
test plan: do an api request that returns a json string with html
entities, or just load up the console and do a "<>&".to_json
Change-Id: Ifaeaa595de4bd621708b43c45f915a67409ef95a
Reviewed-on: https://gerrit.instructure.com/9614
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Brian Palmer <brianp@instructure.com>
the biggie here is to dup options, so that :methods doesn't keep
compounding itself when converting a collection of objects to json
Change-Id: I501cf8c257c8fa2ffa7e15d1cf2a3fe2734c8512
Reviewed-on: https://gerrit.instructure.com/4666
Tested-by: Hudson <hudson@instructure.com>
Reviewed-by: Brian Palmer <brianp@instructure.com>