Commit graph

64 commits

Author SHA1 Message Date
6f1e4037bc
Add support for Grape 3.0 and test in CI 2025-12-08 13:31:38 -08:00
Mateus Nava
cce31fe187
fix: Accept nil serializer (#92)
* fix: Accept nil serializer

* Obey the law

---------

Co-authored-by: Mateus Nava <mateus.nava@corp.globo.com>
Co-authored-by: Sami Samhuri <sami@samhuri.net>
2025-06-08 09:21:41 -04:00
7f759b6560
Preparing for next development iteration, 2.0.1. 2025-06-02 19:09:00 -07:00
0a11b5d101
Out with Travis CI, in with GitHub Actions
* Update dependencies and appease the robot overlords, rubocop and
  danger.
2025-05-24 15:59:00 -07:00
096fd41c11
Bump version to 2.0 and update changelog 2025-04-23 15:27:00 -07:00
7e58753b76
Fix compatibility with Grape 2.3 2025-04-23 15:23:37 -07:00
dblock
7670d9aed7 Upgraded RuboCop to 0.53.0. 2018-03-14 14:58:08 -04:00
dblock
003e69d2bb Preparing for next development iteration, 1.5.3. Closes #84. 2018-03-14 14:50:16 -04:00
dblock
dc01b70f26 Preparing for release, 1.5.2. 2018-03-14 14:49:18 -04:00
Christian Trosclair
b2654190c1 add custom error formatter (#76) 2017-10-20 10:26:32 -04:00
Darren Cheng
fab476772e Prep for v1.5.1 release. 2017-04-25 19:19:50 -07:00
Darren Cheng
1b09c69174 Ensure all AMS options are passed through.
See the following for details:
* https://github.com/rails-api/active_model_serializers/blob/master/docs/general/rendering.md
* https://github.com/rails-api/active_model_serializers/blob/master/docs/general/adapters.md
2017-04-25 19:13:03 -07:00
Darren Cheng
ed5d5b4ca4 Ensure support for Sequel models and datasets. 2017-04-22 17:10:24 -07:00
Darren Cheng
0963774ecc Whitelist adapter options and support extra options. 2016-09-09 10:54:33 -07:00
Darren Cheng
4315930a55 Pass adapter options through calls to render. 2016-09-07 00:06:25 -07:00
Darren Cheng
22ea34d159 Update gem version to v1.5.0. 2016-08-24 10:47:59 -07:00
Darren Cheng
6bb205731a Implement support for collection serializers. 2016-07-26 10:21:34 -07:00
Darren Cheng
629afb9887 Namespace inferred serializer resolution. 2016-07-22 15:18:04 -07:00
Darren Cheng
ac9466192d Refactor option and serializer resolution. 2016-07-21 16:03:46 -07:00
Darren Cheng
1dd73e9cd7 Solve line length linter issues. 2016-07-14 20:09:29 -07:00
Darren Cheng
35abadd8f7 Upgrade codebase to support latest AMS version. 2016-07-14 19:25:58 -07:00
Naoki Kobayashi
78229c9dea Use ActiveModelSerializers::Adapter 2016-07-14 19:17:43 -07:00
syntaxTerr0r
c57a388e91 Bump version to 1.4.0
Adding failing specs for issue #48
Proposition of implementation for #48
Readme update

Rollback travis
2016-05-16 02:48:29 +02:00
Siong
ca9c8faaa9 Merge pull request #39 from jwkoelewijn/options_from_namespace
Look for namespace and other options to configure serializers
2015-01-22 13:49:35 -08:00
dB
f773bcbb8e Use env to pass meta to the formatter. 2015-01-14 14:54:44 -05:00
dB
19bb6b50f7 Simplify meta assignment to a single hash. 2015-01-14 14:53:07 -05:00
J.W. Koelewijn
906d772202 Look for namespace and other options to configure serializers
By default not all serializer options are considered (for instance
the :root option, or the :each_serializer option). This potentially
results in an incomplete configuration of the serializers used.

Added 2 specs to test this when used as a single endpoint and when
used within a namespace. At the moment it is fixed by plucking
the correct settings in the .build_options_from_endpoint,
but I could imagine that this is not exactly the right spot.
2015-01-14 16:35:11 +01:00
dB
04c21470e3 Implemented RuboCop, Ruby linter. 2015-01-13 18:50:18 -05:00
dB
ffd1770ab2 Added support for Grape 0.10.x. 2015-01-13 16:27:36 -05:00
Jonathan Richard Henry Evans
d9c7e7c38d Bump version number 2014-11-20 22:45:36 +00:00
Siong
6426c772a8 Merge branch 'master' into read-options 2014-11-20 12:57:16 -08:00
Andrew Korzhuev
172d1710bb Add Ruby 2 & 2.1 to Travis 2014-10-12 23:02:08 +07:00
Andrew Korzhuev
704838ef5f Read default serializer options from the controller 2014-10-12 22:14:31 +07:00
Xurxo Méndez Pérez
52d8f81395 Makes it possible to use current user within serializers 2014-09-22 11:32:00 +02:00
Radan Skoric
0db4cae3b5 Correctly fetch serialization scope 2014-08-05 10:26:54 +02:00
Jonathan Richard Henry Evans (JRHE)
42ee15ec67 Bump version and update README to reflect changes 2014-07-23 13:32:47 +01:00
Jonathan Richard Henry Evans (JRHE)
b23128934c Merge branch 'master' of github.com:jrhe/grape-active_model_serializers
* 'master' of github.com:jrhe/grape-active_model_serializers:
  fix: when resource is empty, keep json resource root
  support active model serializer 0.9.x
  [Issue #13] Add render syntactic sugar
2014-07-23 13:28:47 +01:00
Jonathan Richard Henry Evans (JRHE)
50bed90643 Bump version to 1.2.0 2014-07-06 00:19:23 +01:00
Stephane Bounmy
94a6122c9e fix: when resource is empty, keep json resource root 2014-07-06 00:12:41 +02:00
Stephane Bounmy
e30af569b2 support active model serializer 0.9.x 2014-06-29 22:18:08 +02:00
Jonathan Richard Henry Evans (JRHE)
ce8fec116f Bump version to 1.2.0 2014-06-14 17:19:47 +01:00
Zander Hill
a7ce076ec7 [Issue #13] Add render syntactic sugar
As in issue #13 an example solution provided by @jrhe an implementation
of said feature has been created.

As per the discussion in the thread this is only a helper to be able to
reach the available options provided in the active_model_serializer gem.

usage is as follows:

```ruby
get '/some_path' do
  collection = Collection.all
  render collection, { meta: { current_page: 5 }, meta_key:
    :pagination_info }
end
```

The return value would be:
`{ pagination_info: { current_page: 5 }, collection: [item, item] }`

If given without a `meta_key` it would return as:
`{ meta: { current_page: 5 }, collection: [item, item] }`

Any feedback appreciated.

@zph, @olleolleolle and @bjoska
2014-02-09 22:51:17 +00:00
Victor Wang
cb4482d827 fix default_root method to support symbol route in grape. 2013-12-18 16:46:38 +08:00
Kyle Passarelli
beb9057b97 add support for 'current_user' 2013-10-07 19:30:20 -06:00
Jonathan Richard Henry Evans
02c2b1451b Bump version to 1.0.1 2013-09-09 13:19:02 +01:00
Jonathan Richard Henry Evans
47772b28e8 Bump version to 1.0.0 2013-09-09 13:10:41 +01:00
Jonathan Richard Henry Evans
639daa9e4f Moves EndpointExtension into grape-active_model_serializers folder as we are not directly monkeypatching 2013-09-09 12:41:24 +01:00
Jonathan Richard Henry Evans
251144d257 Changes root behaviour for arrays. If in a namspace the namespace name is used, if not the route name is used 2013-09-09 12:17:19 +01:00
Jonathan Richard Henry Evans
dddd528ea4 Refactors Formatter 2013-08-29 16:41:03 +01:00
Jonathan Richard Henry Evans
4cba68f095 remove unused class attribute 2013-08-29 15:53:10 +01:00