Commit Graph

225 Commits

Author SHA1 Message Date
Benjamin Fleischer
6d651bc9e3 Bump to 0.10.12 2020-12-10 12:42:12 -05:00
Benjamin Fleischer
dac067fec4 Bump version 2020-12-04 08:59:17 -06:00
Alex Zherdev
7e1c9fcf64 Update changelog 2019-10-17 10:43:47 -07:00
Wasif Hossain
669c4eebef
Update README and CHANGELOG 2019-07-18 19:31:36 +06:00
Wasif Hossain
433c0c646f
Bump version to 0.10.10 2019-07-13 15:30:49 +06:00
Rafael Gaspar
beffbb2bd3
Follows inheritance with a namespace
Co-authored-by: Rafael Gaspar <rafael.gaspar@me.com>
Co-authored-by: Darryl Pogue <darryl@dpogue.ca>
Co-authored-by: Artin Boghosian <artinboghosian@gmail.com>
2019-07-10 11:41:32 -07:00
Mark Havekes
cee0ad4494 update changelog 2019-06-13 10:52:44 +02:00
Grey Baker
14113ba85b Slim down bundled gem by excluding test files and docs 2019-04-23 15:06:40 +01:00
Wasif Hossain
96303af45f
Add changelog entries for this PR and #2327 2019-04-23 15:14:35 +06:00
Kyle Keesling
912af7ef91
update test fixture schema to use timestamps instead of timestamp
- discovered via @wasifhossain
- Update CHANGELOG.md
2019-03-14 11:00:45 -04:00
Benjamin Fleischer
bb0f9d088d Bump version to 0.10.9 2019-02-08 11:25:53 -06:00
cintamani
15b7974fac
Merge pull request #2288 from cintamani/patch-1
Change the fetch method to deal with recyclable key cache strategy
2019-02-08 12:14:03 +00:00
cintamani
2cc2a048c6
Update CHANGELOG.md
Run tests again
2019-02-08 11:09:05 +00:00
Krzysztof Rybka
209834dc49 Performance and memory usage fixes (#2309)
* Use select and reject instead of partition.map

* Sort adapters keys in place

* Just select from options

* Add changelog entry
2019-01-29 15:38:11 -06:00
cintamani
7f751fc1f7 Add test coverage and changelog 2019-01-29 16:00:18 +00:00
Nikita Sokolov
a39794df5b LazyAssociation#object should not reevaluate reflection values 2019-01-09 09:52:38 +03:00
Benjamin Fleischer
bc4805cbc1 Bump version to v0.10.8 2018-11-01 16:24:08 -05:00
Benjamin Fleischer
f1a2ec7f99 Add change to changelog 2018-11-01 16:19:43 -05:00
Konstantin Munteanu
0d3999c36d Support conditions in link statements 2018-10-25 09:45:34 +02:00
Benjamin Fleischer
01ecc5dea3 Update Changelog 2018-10-24 17:01:25 -05:00
Benjamin Fleischer
eb865c276d Update Changelog 2018-10-11 15:03:44 -05:00
Benjamin Fleischer
ca531789c3 Bump to 0.10.7; update changelog 2017-11-14 20:50:51 -06:00
Benjamin Fleischer
33ec26fa12 Merge branch 'stratigos-patch-1' into 0-10-stable 2017-10-31 16:46:20 -05:00
Todd Morningstar
0bbeeb384e Update serializers.md
* Add note that any controller reference is acceptable for `serialization_scope`
 * Add note about `ActionController::API` and `view_context` set to `nil`, with respect to accessing helpers in a Serializer
 * refs #2144
 * Update CHANGELOG.md
2017-10-31 17:15:43 -04:00
Joe Meredith
c6a14c9eac Fail if collection type cannot be inferred with json adapter (#2210) 2017-10-30 13:37:37 -04:00
Nate Pinsky
88367da970 Add warnings about global adapter config to docs (#2176) 2017-10-24 17:30:56 -05:00
Dennis Stumm
4d7c2457d7 Fix deserialization of polymorphic relationships (#2200)
* Classify the relationship type for polymorphic associations
2017-10-07 17:03:38 -05:00
Geremia Taglialatela
1c9214d041
Update version constraint for jsonapi-renderer 2017-09-19 16:57:09 +02:00
Christian
a89e78c655 Allow referencing sideloaded include by key. (#2136)
* If a `key` is set on the reflection use the `key` instead of `name`.
This ensures that associations with a key set are still included.
2017-05-18 15:59:14 -05:00
Grey Baker
be7ee70376 Allow serialized ID to be overwritten for belongs-to relationships
If the `id` attribute for a class isn't taken directly from the object when
serializing it, it may be desirible for other classes that serialize a
relationship with that class to overwrite the relationship IDs they serialize.

For example, suppose we have:

```(ruby)
class Repo < Model
  attributes :id, :github_id, :name
  associations :configs
end

class Config < Model
  attributes :id
  belongs_to :repo
end

class RepoSerializer < ActiveModel::Serializer
  attributes :id, :name

  has_many :update_configs

  def id
    object.github_id
  end
end

class ConfigSerializer < ActiveModel::Serializer
  attributes :id
  belongs_to :repo
end
```

In the above example, serializing a list of `Repo`s will give the `github_id`
for each one, but serializing a `Config` will give the `id` for its parent repo.

Ideally AMS would inspect the `RepoSerializer` when serializing the `Config`,
and realise it can't just output the foreign key. Unfortunately, getting the
serialization class for the child repo currently requires loading the record
(via evaluating `lazy_assocation`), and loses the performance benefit of the
existing `belongs_to?` path. Instead, I've opted to use
`read_attribute_for_serialization` instead of `object.send` to fetch the
serialized foreign key. This allows the serialized relationship ID to be
overwritten using

```(ruby)
class ConfigSerializer < ActiveModel::Serializer
  ...

  def repo_id
    object.repo.github_id
  end
end
```
2017-05-13 15:22:18 +01:00
Benjamin Fleischer
b48aeeef1e Merge branch 'master' into 0-10-stable 2017-05-01 11:04:46 -05:00
Benjamin Fleischer
dff621e174 Bump to v0.10.6 2017-05-01 10:59:14 -05:00
Cassidy K
aa619b5e0e Update Serializers and Rendering Docs
- Updating general/serializers.md
- Updating docs/general/rendering.md
- adding to changelog
- Updating rendering.md to indicate that `each_serializer` must be used on a collection
- updating my handle in previous changelog entry
2017-04-19 11:29:20 -04:00
Timur
1a5e66b933 [0.10] add docs for include (#2081)
* Add docs for `include` option in the adapter
2017-03-28 02:16:45 -05:00
Benjamin Fleischer
01d4f0464b Merge branch 'master' into 0-10-stable 2017-03-07 15:52:27 -06:00
Benjamin Fleischer
28b8e3dd17 Bump to v0.10.5 2017-03-07 15:41:20 -06:00
Jared Beck
1005aa60a9 Update version constraint for jsonapi-renderer
Currently (2017-02-20) the latest version is 0.1.2.

Why not use a version constraint like '~> 0.1.1'? Because
we know of no reason why 0.1.1.beta1 cannot still be used.
That said, we have done no research looking for such a reason.
2017-02-20 15:02:51 -05:00
Jared Beck
a081e4ffc4 jsonapi is deprecated, just use jsonapi-renderer
From the author of jsonapi:

> .. The jsonapi gem was previously just a bundle of jsonapi-serializer and jsonapi-renderer, and AMS is using only a helper class of jsonapi-renderer (namely JSONAPI::IncludeDirective). The AMS dependency was previously not properly pinned to a specific version, which I saw as a risk for many users, so I avoided updating this gem. Moreover, the name jsonapi being somewhat too generic for what this gem evolved into (namely jsonapi-rb, which bundles jsonapi-renderer and jsonapi-parser, along with serializers and deserializers, with tight integrations with various frameworks), I decided to stay away from it for fairness.
> TL;DR: Yes, people should use jsonapi-parser and jsonapi-renderer directly (or give a try to jsonapi-rb, depending on their needs).

We should also update jsonapi-renderer to the latest, currently 0.1.2, but I thought that should be a separate PR.
2017-02-17 17:01:22 -05:00
Benjamin Fleischer
1e47c167a1 Merge branch 'master' into patch-1 2017-01-31 09:07:52 -06:00
Igor Zubkov
775ad66ffd Update CHANGELOG.md 2017-01-24 15:12:25 +02:00
MSathieu
bd50ae9ada Update CHANGELOG.md 2017-01-23 07:24:41 +01:00
Benjamin Fleischer
93ca27fe44 Merge 0-10-stable into master (to fix breaking change). (#2023)
* Merge pull request #1990 from mxie/mx-result-typo

Fix typos and capitalization in Relationship Links docs [ci skip]

* Merge pull request #1992 from ojiry/bump_ruby_versions

Run tests by Ruby 2.2.6 and 2.3.3

* Merge pull request #1994 from bf4/promote_architecture

Promote important architecture description that answers a lot of questions we get
Conflicts:
	docs/ARCHITECTURE.md

* Merge pull request #1999 from bf4/typos

Fix typos [ci skip]

* Merge pull request #2000 from berfarah/patch-1

Link to 0.10.3 tag instead of `master` branch

* Merge pull request #2007 from bf4/check_ci

Test was failing due to change in JSON exception message when parsing empty string

* Swap out KeyTransform for CaseTransform (#1993)

* delete KeyTransform, use CaseTransform

* added changelog

Conflicts:
	CHANGELOG.md

* Merge pull request #2005 from kofronpi/support-ruby-2.4

Update jsonapi runtime dependency to 0.1.1.beta6

* Bump to v0.10.4

* Merge pull request #2018 from rails-api/bump_version

Bump to v0.10.4 [ci skip]
Conflicts:
	CHANGELOG.md

* Merge pull request #2019 from bf4/fix_method_redefined_warning

Fix AMS warnings

* Merge pull request #2020 from bf4/silence_grape_warnings

Silence Grape warnings

* Merge pull request #2017 from bf4/remove_warnings

Fix mt6 assert_nil warnings

* 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

* Merge pull request #2012 from bf4/cleanup_isolated_jsonapi_renderer_tests_a_bit

Cleanup assertions in isolated jsonapi renderer tests a bit

* Add Model#attributes helper; make test attributes explicit

* Fix model attributes accessors

* Fix typos

* Randomize testing of compatibility layer against regressions

* Test bugfix

* Add CHANGELOG

* Merge pull request #1981 from groyoh/link_doc

Fix relationship links doc
Conflicts:
	CHANGELOG.md
2017-01-10 02:28:50 -06:00
Benjamin Fleischer
9a2f4894ed Merge pull request #1981 from groyoh/link_doc
Fix relationship links doc
Conflicts:
	CHANGELOG.md
2017-01-10 01:07:18 -06:00
Benjamin Fleischer
1570437795 Add CHANGELOG 2017-01-10 00:41:09 -06:00
Benjamin Fleischer
2a6d373cb2 Merge pull request #1981 from groyoh/link_doc
Fix relationship links doc
2017-01-09 23:57:37 -06:00
Benjamin Fleischer
d5babdd060 Add Model#attributes helper; make test attributes explicit 2017-01-07 21:50:11 -06:00
Benjamin Fleischer
655c721d0d Bump to v0.10.4
Conflicts:
	CHANGELOG.md
2017-01-06 16:23:54 -06:00
Benjamin Fleischer
82db1301f6 Bump to v0.10.4 2017-01-06 16:21:04 -06:00
L. Preston Sego III
adf110f4df Swap out KeyTransform for CaseTransform (#1993)
* delete KeyTransform, use CaseTransform

* added changelog

Conflicts:
	CHANGELOG.md
2017-01-06 14:17:37 -06:00
Yohan Robert
91128fadb8 [skip ci] Fix relationship link documentation 2016-12-30 21:02:03 +01:00