Commit graph

106 commits

Author SHA1 Message Date
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
jrhe
5bba714457 Merge pull request #38 from dblock/rubocop
Implemented RuboCop, Ruby linter.
2015-01-13 23:58:39 +00:00
dB
04c21470e3 Implemented RuboCop, Ruby linter. 2015-01-13 18:50:18 -05:00
Siong
cc6389f0ca Merge pull request #36 from dblock/grape-10
Added support for Grape 0.10.x
2015-01-13 15:35:31 -08:00
dB
ffd1770ab2 Added support for Grape 0.10.x. 2015-01-13 16:27:36 -05:00
dB
40e04ef23e Test against multiple versions of Grape. 2015-01-13 09:25:35 -05:00
Siong
4d785b4754 Fix indentation on README. 2014-12-08 15:27:12 -08:00
Siong
7f243c017d fix typo on README. fix #34. 2014-12-08 15:26:18 -08:00
jrhe
c48d3ed07c Removes looking for maintainer message 2014-11-21 22:39:00 +00:00
jrhe
c9bf16b1ce Merge pull request #29 from ignat-zakrevsky/test-fixes
Tests fixing.
2014-11-21 19:11:01 +00:00
Ignat Zakrevsky
f6feb5f5ef Merge branch 'master' into test-fixes
Conflicts:
	spec/grape-active_model_serializers/formatter_spec.rb
2014-11-21 09:30:11 +03:00
Jonathan Richard Henry Evans
4085f90432 Adds new maintainers message to readme 2014-11-20 22:50:13 +00:00
Jonathan Richard Henry Evans
d9c7e7c38d Bump version number 2014-11-20 22:45:36 +00:00
jrhe
3a0a1b4eee Merge pull request #30 from OutrageousLabs/read-options
read options from default_serializer_options.
2014-11-20 22:10:18 +00:00
Siong
28de380fc2 update README. 2014-11-20 13:29:41 -08:00
Siong
a2578f893d add spec for default_serializer_options. 2014-11-20 13:23:15 -08:00
Siong
cfb80be11e better formatting. 2014-11-20 13:22:53 -08:00
Siong
6426c772a8 Merge branch 'master' into read-options 2014-11-20 12:57:16 -08:00
Ignat Zakrevsky
6e8757dd88 Tests fixing. 2014-11-17 12:28:51 +03:00
jrhe
c2aed6f8c8 Merge pull request #27 from andrusha/look-ma-no-hands
Enable Ruby 2 and 2.1 on Travis
2014-10-12 18:32:21 +01:00
Andrew Korzhuev
172d1710bb Add Ruby 2 & 2.1 to Travis 2014-10-12 23:02:08 +07:00
Andrew Korzhuev
e510817abf Remove jazz-hands dependency 2014-10-12 23:01:58 +07:00
Andrew Korzhuev
704838ef5f Read default serializer options from the controller 2014-10-12 22:14:31 +07:00
jrhe
85b92a4856 Merge pull request #24 from sonxurxo/master
Makes it possible to use current_user within serializers
2014-10-06 13:01:09 +01:00
jrhe
a2c8632ce2 Merge pull request #25 from DanyHunter/patch-1
Update dependency version for active_model_serializers
2014-10-06 13:00:38 +01:00
DanyHunter
9e56991a50 Modify first argument for Grape::Endpoint.new to fix error caused by calling a method on nil. 2014-10-02 11:09:55 -05:00
Daniel Ochoa
1625bd2603 Update dependency version for active_model_serializers
Using Alpha1 breaks when adding a `has_one` relation and the relation is not set, throwing an error of `TypeError - no implicit conversion of nil into Array`
2014-10-02 10:30:39 -05:00
Xurxo Méndez Pérez
52d8f81395 Makes it possible to use current user within serializers 2014-09-22 11:32:00 +02:00
jrhe
56121ad6d1 Merge pull request #21 from radanskoric/fix-for-0.9.x
Correctly fetch serialization scope
2014-08-20 23:35:07 -04:00
Radan Skoric
0db4cae3b5 Correctly fetch serialization scope 2014-08-05 10:26:54 +02:00
Jonathan Richard Henry Evans (JRHE)
a4ae1d64e9 Move 1.2.1 changes out of breaking changes 2014-07-23 13:42:43 +01:00
Jonathan Richard Henry Evans (JRHE)
4bef8357df Update readme to use full class names for serializer rather than the symbol #19 2014-07-23 13:42:07 +01:00
Jonathan Richard Henry Evans (JRHE)
92a2a5ba82 Ignore .gem files 2014-07-23 13:33:19 +01: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
jrhe
65577dfc2c Merge pull request #18 from sbounmy/active-model-serializers-0-9-x
support active model serializer 0.9.x
2014-07-06 00:16:37 +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
jrhe
cfc6a02c65 Merge pull request #15 from zph/issue_13
[Issue #13] Add render syntactic sugar
2014-06-19 14:51:51 +01: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
jrhe
3a35a468a5 Merge pull request #14 from wjp2013/master
fix default_root method to support symbol route in grape.
2013-12-19 07:32:33 -08:00
Victor Wang
cb4482d827 fix default_root method to support symbol route in grape. 2013-12-18 16:46:38 +08:00
jrhe
c41e24070e Merge pull request #12 from blue-kite/master
Add basic support for 'current_user'
2013-12-12 08:41:26 -08:00
Kyle Passarelli
beb9057b97 add support for 'current_user' 2013-10-07 19:30:20 -06:00
Kyle Passarelli
4b474ef8f2 remove '.DS_Store's 2013-10-07 18:20:06 -06:00
jrhe
29753df643 Merge pull request #11 from schickling/patch-1
Fixed require path
2013-10-04 00:47:10 -07:00
Johannes Schickling
ee911f2669 Fixed require path 2013-10-03 14:38:20 +02:00
Jonathan Richard Henry Evans
c84a0ea230 Adds warning about change of array root behaviour in 1.0 2013-09-09 15:54:43 +01:00