Commit Graph

13 Commits

Author SHA1 Message Date
James Williams c0ac1dfcdd rails 4.2: allow bootup
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>
2015-12-30 18:30:27 +00:00
James Williams d2833299d7 remove rails 3 support
also add initial rails 4.2 scaffold

refs #CNVS-25988

Change-Id: Ifd7aecaffb6cfc8a3e41bc3fb011fb6ce0664ea6
Reviewed-on: https://gerrit.instructure.com/69129
Tested-by: Jenkins
Reviewed-by: Cody Cutrer <cody@instructure.com>
Product-Review: James Williams  <jamesw@instructure.com>
QA-Review: James Williams  <jamesw@instructure.com>
2015-12-23 21:36:43 +00:00
Brian Palmer 99de86e787 rails 4.0.10
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>
2014-09-16 22:07:39 +00:00
Cody Cutrer 48864de3f6 begin rails 4
enough for bundle install to work with 4.1.5

Change-Id: I277df9e4315fa250b6028139113c74721148e2f0
Reviewed-on: https://gerrit.instructure.com/39656
Reviewed-by: Brian Palmer <brianp@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
Product-Review: Cody Cutrer <cody@instructure.com>
QA-Review: Cody Cutrer <cody@instructure.com>
2014-08-27 23:09:17 +00:00
James Williams 81558f728c remove rails 2 support
closes #CNVS-14261

Change-Id: I1b0e8a4438ab659ecd1ac8462bc3559d810989b3
Reviewed-on: https://gerrit.instructure.com/38744
Reviewed-by: Cody Cutrer <cody@instructure.com>
Product-Review: Cody Cutrer <cody@instructure.com>
QA-Review: Cody Cutrer <cody@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
2014-08-06 18:16:19 +00:00
Brian Palmer 83f8dcd653 escape html chars in json in rails3
closes CNVS-11784

Change-Id: I4d86d11244ee32b46768c8d18431dc9e188e132b
Reviewed-on: https://gerrit.instructure.com/31755
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Cody Cutrer <cody@instructure.com>
Product-Review: Brian Palmer <brianp@instructure.com>
QA-Review: Brian Palmer <brianp@instructure.com>
2014-03-11 22:08:48 +00:00
Derek DeVries de6a2dabab rails3: fix quiz submission questions api spec failures
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>
2014-02-26 22:44:15 +00:00
Brian Palmer 6f9be4fd13 use Oj for parsing and serializing json requests/responses
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>
2013-11-05 23:04:56 +00:00
Jacob Fugal 3f0968bb52 application/json+canvas-string-ids Accept header
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>
2013-10-02 18:05:31 +00:00
Jacob Fugal 65aae8230c add fast as_json calls to nil/true/false
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>
2013-08-29 16:42:41 +00:00
Brian Palmer b2a8838a7d use built-in escape_html_entities_in_json support
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>
2012-04-27 14:22:28 -06:00
Cody Cutrer 69a10d4b5a optimize json creation and serialization
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>
2011-07-14 10:46:08 -06:00
Jon Jensen d6e5502ac2 fix html escaping issues in the gradebook and elsewhere, fixes gh issues #18 and #21
Change-Id: Ie803a8b8b435e58f7062b616836f811549c84822
Reviewed-on: https://gerrit.instructure.com/3903
Tested-by: Hudson <hudson@instructure.com>
Reviewed-by: Brian Palmer <brianp@instructure.com>
2011-05-27 12:42:25 -06:00