Commit Graph

5 Commits

Author SHA1 Message Date
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
Cody Cutrer 8011a31973 use require_dependency for reloadable constants
Change-Id: I88e032d90d7084d9a90644c555acb91bc9879d5f
Reviewed-on: https://gerrit.instructure.com/37713
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Jacob Fugal <jacob@instructure.com>
Product-Review: Cody Cutrer <cody@instructure.com>
QA-Review: Cody Cutrer <cody@instructure.com>
2014-07-16 16:43:46 +00:00
Raphael Weiner 91944495c2 convert sanitize field plugin into proper gem: CanvasSanitize
Change-Id: I5562a318bb3f52c1374a3a69f288bfb2381f8ee7
Reviewed-on: https://gerrit.instructure.com/29405
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Stephan Hagemann <stephan@pivotallabs.com>
Product-Review: Stephan Hagemann <stephan@pivotallabs.com>
Reviewed-by: Brian Palmer <brianp@instructure.com>
QA-Review: Brian Palmer <brianp@instructure.com>
2014-01-28 22:36:18 +00:00
Stanley Stuart cd00879045 improve relationship support for Canvas::APISerializer
Adds better support for relationships with regards to
ActiveModel::Serializers through Canvas::APISerializer:

- Serializing a url is now the default if your relationship is
`embed: :ids` (implied embed_in_root: false)
- Serializing IDs is the default if your relationship is
`embed: :ids, embed_in_root: true` (relationship is sideloaded with
the main response)
- Stringifying ids is now the default. You can opt out by defining
a `stringify_ids?` method on your serializer.
- Introduce Canvas::APIArraySerializer for our own needs since
ActiveModel::ArraySerializer calls `serializable_object` instead
of `as_json`, bypassing stringification.

Also fixes an issue where subclassing Canvas::APISerializer
would not get stringified if you overrode `serializable_object`.

test plan:
  - make sure the jsonapi version of the quizzes api still works.

Change-Id: I301648d3e21b887eb7c2502cc00dec023fbbf79d
Reviewed-on: https://gerrit.instructure.com/28116
QA-Review: Myller de Araujo <myller@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Jacob Fugal <jacob@instructure.com>
Product-Review: Stanley Stuart <stanley@instructure.com>
2014-01-20 19:37:58 +00:00
Stanley Stuart 5f2089c889 import ActiveModel::Serializers port and convert quizzes api to it
test plan:
  - The quiz api should work like it normally does when you don't pass
    an 'Accept: application/vnd.api+json' header.
  - The quizzes index page and quiz edit page should work like they
    always do.
  - Testing the Quizzes API for "jsonapi" style:
    - For all requests, you MUST have the "Accept" header set to
      "application/vnd.api+json"
    - Test all the endpoints (PUT, POST, GET, INDEX, DELETE) like you
      normally would, except you'll need to format the data according to
      the next few steps:
      - For "POST" and "PUT" (create and update) requests, you should send
        the data like: { "quizzes": [ { id: 1, title: "blah" } ]
      - For all requests (except DELETE), you should get back a response
        that looks like: { "quizzes": [ { quiz you requested } ]
    - For the "delete" action, you should get a "no content" response
      and the request should be successful

Change-Id: Ie91deaeb6772cbe52a0fc46a28ab93a4e3036061
Reviewed-on: https://gerrit.instructure.com/25997
Reviewed-by: Jacob Fugal <jacob@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
QA-Review: Caleb Guanzon <cguanzon@instructure.com>
Product-Review: Stanley Stuart <stanley@instructure.com>
2013-12-26 20:32:39 +00:00