Commit Graph

1504 Commits

Author SHA1 Message Date
Benjamin Fleischer
ec045a5388 Merge pull request #2012 from bf4/cleanup_isolated_jsonapi_renderer_tests_a_bit
Cleanup assertions in isolated jsonapi renderer tests a bit
2016-12-25 13:42:33 -06:00
Benjamin Fleischer
6cf84c11e0 Less strict exception matching 2016-12-24 21:29:46 -06:00
Benjamin Fleischer
4394f76b86 Cleanup assertions in isolated jsonapi renderer tests a bit 2016-12-24 21:28:15 -06:00
Ankit Shah
f246741cc5 Updated isolated tests to assert correct behavior. (#2010)
* Updated isolated tests to assert correct behavior.
* Added check to get unsafe params if rails version is great than 5
2016-12-24 20:34:07 -06:00
Benjamin Fleischer
4e430132db Merge pull request #2005 from kofronpi/support-ruby-2.4
Update jsonapi runtime dependency to 0.1.1.beta6
2016-12-23 11:24:38 -06:00
Benjamin Fleischer
3f46846891 Merge pull request #2007 from bf4/check_ci
Test was failing due to change in JSON exception message when parsing empty string
2016-12-23 11:24:23 -06:00
Benjamin Fleischer
c1fc0e4371 Handle different messages from different versions of JSON gem 2016-12-23 11:14:59 -06:00
Pierre-Alexandre Kofron
9eacf9f3b7 Update jsonapi runtime dependency to 0.1.1.beta6 2016-12-16 18:00:49 +01:00
Benjamin Fleischer
95f832fd0e Merge pull request #2000 from berfarah/patch-1
Link to 0.10.3 tag instead of `master` branch
2016-12-14 20:30:59 -06:00
Bernardo Farah
0976bdc4d0 Link to 0.10.3 tag instead of master branch
It may be less confusing for new users if the docs link them to the current stable release. It could reduce issues like [this one](https://github.com/rails-api/active_model_serializers/issues/1988)
2016-12-14 11:37:18 -08:00
Benjamin Fleischer
bbcadec96a Merge pull request #1999 from bf4/typos
Fix typos [ci skip]
2016-12-13 09:23:29 -06:00
Benjamin Fleischer
05430fb233 Fix typos
```
go get -u github.com/client9/misspell/cmd/misspell
misspell  -w -q -error -source=text {app,config,lib,test}/**/*
```

>   workers   = flag.Int("j", 0, "Number of workers, 0 = number of CPUs")
>   writeit   = flag.Bool("w", false, "Overwrite file with corrections (default is just to display)")
>   quietFlag = flag.Bool("q", false, "Do not emit misspelling output")
>   outFlag   = flag.String("o", "stdout", "output file or [stderr|stdout|]")
>   format    = flag.String("f", "", "'csv', 'sqlite3' or custom Golang template for output")
>   ignores   = flag.String("i", "", "ignore the following corrections, comma separated")
>   locale    = flag.String("locale", "", "Correct spellings using locale perferances for US or UK.  Default is to use a neutral variety of English.  Setting locale to US will correct the British spelling of 'colour' to 'color'")
>   mode      = flag.String("source", "auto", "Source mode: auto=guess, go=golang source, text=plain or markdown-like text")
>   debugFlag = flag.Bool("debug", false, "Debug matching, very slow")
>   exitError = flag.Bool("error", false, "Exit with 2 if misspelling found")
2016-12-11 23:41:23 -06:00
L. Preston Sego III
0422a1e772 Swap out KeyTransform for CaseTransform (#1993)
* delete KeyTransform, use CaseTransform

* added changelog
2016-12-07 10:49:38 -05:00
Benjamin Fleischer
fca2d4515d Merge pull request #1994 from bf4/promote_architecture
Promote important architecture description that answers a lot of questions we get
2016-12-07 07:07:26 -06:00
Benjamin Fleischer
847f50a13c Merge pull request #1984 from bf4/make_test_attributes_explicit
Make test attributes explicit
2016-12-06 14:53:13 -06:00
Benjamin Fleischer
3b84845241 Add CHANGELOG 2016-12-04 19:33:39 -06:00
Benjamin Fleischer
f8ca912de8 Add failing test for AMS::Model accessor vs. attributes mutation 2016-12-04 19:33:39 -06:00
Benjamin Fleischer
80af763d2e Make test attributes explicit
- Organize test poros with associations and by serializer
- Freeze derived attributes/associations against mutation
- Cleanup PORO fixtures
2016-12-04 19:33:39 -06:00
Benjamin Fleischer
15a8f2c1eb Promote important architecture description that answers a lot of questions we get 2016-12-04 15:26:44 -06:00
L. Preston Sego III
e575156fe7 Merge pull request #1992 from ojiry/bump_ruby_versions
Run tests by Ruby 2.2.6 and 2.3.3
2016-12-03 15:45:08 -05:00
Ryoji Yoshioka
095ad9c82c Run tests by Ruby 2.2.6 and 2.3.3 2016-12-04 00:20:24 +09:00
Benjamin Fleischer
9b25680514 Merge pull request #1990 from mxie/mx-result-typo
Fix typos and capitalization in Relationship Links docs [ci skip]
2016-11-29 13:29:22 -06:00
Melissa Xie
3733efaf99 Use consistent capitalization for JSONAPI adapter references 2016-11-29 10:41:16 -05:00
Melissa Xie
4f72cc7d8c Fix "result" typo 2016-11-29 10:38:12 -05:00
Benjamin Fleischer
93bbc59e14 Merge pull request #1982 from bf4/better_ams_model_interface
Better AMS Model attributes interface
2016-11-21 09:18:38 -06:00
Benjamin Fleischer
772b7999c5 Better AMS Model attributes interface 2016-11-21 09:14:26 -06:00
Benjamin Fleischer
cd09e89006 Bump to 0.10.3 2016-11-21 08:55:22 -06:00
Alex Popov
d39dd04c11 Update SerializableResource documentation (#1977)
Mention that ActiveModelSerializers::SerializableResource.new can be used for
single resource as well as for collections
2016-11-17 13:57:07 +01:00
L. Preston Sego III
d31d741f43 Make serializer lookup configurable (#1757) 2016-11-16 18:38:40 +01:00
Yohan Robert
d0de53cbb2 Fix namespace lookup for collections and has_many (#1973) 2016-11-15 08:35:58 -05:00
L. Preston Sego III
c9a96a05ed Trigger 2016-11-09 08:05:10 -05:00
L. Preston Sego III
b29395b0ac This adds namespace lookup to serializer_for (#1968)
* This adds namespace lookup to serializer_for

* address rubocop issue

* address @bf4's feedback

* add docs

* update docs, add more tests

* apparently rails master doesn't have before filter

* try to address serializer cache issue between tests

* update cache for serializer lookup to include namespace in the key, and fix the tests for explicit namespace

* update docs, and use better cache key creation method

* update docs [ci skip]

* update docs [ci skip]

* add to changelog [ci skip]
2016-11-09 07:57:39 -05:00
Julia
b709cd41e6 Improve type method documentation (#1967) 2016-11-04 16:49:48 +01:00
大野峻典
ce8dd36633 Add documentation for root (#1959) 2016-11-01 19:25:52 +01:00
Lucas Hosseini
cb20b957ed Pin jsonapi version. (#1955) 2016-10-25 07:43:40 -04:00
Benjamin Fleischer
6c6e45b23f Replace fail/rescue CollectionSerializer::NoSerializerError with throw/catch :no_serializer (#1767) 2016-09-26 10:18:27 -04:00
Benjamin Fleischer
c69855bfaa Improve readability of relationships test (#1904)
* Really fix intermittent relationship test failures

* Unify the two JSON API relationship test files

I accidentally introduced the duplication when
merging
https://github.com/rails-api/active_model_serializers/pull/1543#issuecomment-193118782
and they've evolved separately since then.

They both have some value and need to be combined.

* Resolve duplicate tests from diverged tests files

* No longer test Association/Relationship interface directly
2016-09-26 09:23:40 -04:00
Lee Richmond
2145540795 Add include_data :if_sideloaded (#1931)
For JSONAPI, `include_data` currently means, "should we populate the
'data'" key for this relationship. Current options are true/false.

This adds the `:if_sideloaded` option. This means "only
populate the 'data' key when we are sideloading this relationship." This
is because 'data' is often only relevant to sideloading, and causes a
database hit.

Addresses https://github.com/rails-api/active_model_serializers/issues/1555
2016-09-25 12:57:19 -04:00
L. Preston Sego III
6ed499f38e added active record benchmark (#1919)
* added active record benchmark

* address bf4's feedbock

* fix spacing
2016-09-24 16:39:29 -04:00
Brendon Muir
0606b06abd Update upgrade_from_0_8_to_0_10.md (#1933)
Update upgrade_from_0_8_to_0_10.md

Changes the upgrade guide to highlight the change in the way relationships are walked.
2016-09-20 13:38:53 -04:00
Lee Richmond
a77dfdaa85 Ensure valid jsonapi when blank relationship (#1930)
If you specify include_data false, and do not have any links for this
relationship, we would output something like:

`{ relationships: { comments: {} } }`

This is not valid jsonapi. We will now render

`{ relationships: { comments: { meta: {} } } }`

Instead.

Relevant jsonapi spec: http://jsonapi.org/format/#document-resource-object-relationships
2016-09-19 14:10:50 -04:00
Lee Richmond
a032201a91 Merge pull request #1922 from ggpasqualino/master
Make railties an optional dependency
2016-09-14 09:00:30 -07:00
L. Preston Sego III
810efb838d add bm_adapter (#1914) 2016-09-13 11:20:20 -04:00
Guilherme
e8f055a682 Add chengelog entry about the issue 2016-09-13 17:16:43 +02:00
Guilherme
586ad64be7 Make railties an optional dependency 2016-09-09 16:07:08 +02:00
Ikariusrb
58ebf96e03 Update ember-and-json-api.md (#1894)
* Update ember-and-json-api.md

Removed ember-data adapter change to support include directives, as it's now built-in.  Updated the documentation for how to add include directives to ember store queries, and added documentation covering how to tell Rails that we are consuming and generating jsonapi data

* Fix up format for parameter restrictions

* Update ember-and-json-api.md

Updates to address comments; explain why Rails should know what format we are consuming/generating, reword introduction to include: examples, and fix render statement to specify jsonapi instead of json.
2016-09-07 16:26:33 -04:00
Mario Olivio Flores
1899437566 Add info on setting polymorphic serializers (#1906)
While this same document provides details on how to override the
serializer_for, not all users will realize this could be used to set the
sterilizers for polymorphic relationships.  This change just adds a link
to that documentation and makes that point obvious.
2016-09-07 15:22:08 -04:00
Filippos Vasilakis
50f27546c3 Add docs for links (#1909)
Add docs for links

Add docs for links

Add docs for links

Add docs for links

Add docs for links

Add controller info

Grammar fixing

Improve docs

some small wording changes

Add pr to changelog
2016-09-07 15:10:45 -04:00
Lee Richmond
11bd778f17 Merge pull request #1912 from richmolj/generator
Ensure generator picks up ApplicationSerializer
2016-09-06 12:42:37 -07:00
Lee Richmond
2ea8bb7f40 Merge pull request #1917 from richmolj/disable_pagination_links
Disable pagination links via config
2016-09-06 12:41:18 -07:00