We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 4a4f757 commit 5fecef5Copy full SHA for 5fecef5
test/unit/serializing_test.rb
@@ -6,6 +6,10 @@ class LimitedField < TestResource
6
self.read_only_attributes += ['foo']
7
end
8
9
+ class NestedResource < TestResource
10
+ belongs_to :bar
11
+ end
12
+
13
class CustomSerializerAttributes < TestResource
14
15
protected
@@ -317,4 +321,19 @@ def test_underscored_relationship_key_serialization
317
321
assert_equal expected, article.as_json_api['relationships']
318
322
319
323
324
325
+ def test_ensure_nested_path_params_not_serialized
326
+ resource = NestedResource.new(foo: 'bar', id: 1, bar_id: 99)
327
328
+ expected = {
329
+ 'id' => 1,
330
+ 'type' => "nested_resources",
331
+ 'attributes' => {
332
+ 'foo' => 'bar'
333
+ }
334
335
336
+ assert_equal expected, resource.as_json_api
337
338
320
339
0 commit comments