fields-serializer 0.6.3 → 0.6.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/lib/fields/serializer/action_controller.rb +5 -6
- data/lib/fields/serializer/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 30960fcbcf7ca34b2afab4071e75e25a5dff9985
|
4
|
+
data.tar.gz: 0caa871a6b14bdac321bc4f3b53003d4ea1d398d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 2302de02d444424bfc02b88d7ccf750f20f003ef649d930dab22b027cbc9cf02be5582b8caf400dd63c6e6f385d8c45b00a7f42c6f2993f536823f3a41996507
|
7
|
+
data.tar.gz: 4c96cf021d40bc3f5162b1e4fc37c7917b9c5baa86dbb6aa301d6f58b4c0b07ef57c4706ef0c7cc6204292b11e4515b536cb1f3ff134c4407d2d7329649d6f8a
|
@@ -6,13 +6,12 @@ module Fields
|
|
6
6
|
extend ActiveSupport::Concern
|
7
7
|
|
8
8
|
|
9
|
-
# Render the result of an ActiveRecord query including only the fields specified
|
10
|
-
# or the whole serialized objects.
|
9
|
+
# Render the result of an ActiveRecord::Relation query including only the fields specified
|
11
10
|
#
|
12
|
-
# @param [
|
13
|
-
# @option options [Array] :fields
|
14
|
-
# @option options [Class] :model_class
|
15
|
-
# @option options [Hash] :options
|
11
|
+
# @param [ActiveRecord::Relation] query - The query to render in json
|
12
|
+
# @option options [Array] :fields - The list of fields to return in json api syntax
|
13
|
+
# @option options [Class] :model_class - The model class of the objects to be queried to optimize db hits.
|
14
|
+
# @option options [Hash] :options - Any other valid option to render method.
|
16
15
|
def render_json_fields(query, **options)
|
17
16
|
fields = options.delete(:fields)
|
18
17
|
model_class = options.delete(:model_class)
|