mirror of
https://github.com/ditkrg/active_model_serializers.git
synced 2026-01-25 07:16:49 +00:00
re: RuboCop: Bulk minor style corrections
This commit is contained in:
@@ -22,10 +22,8 @@ module ActiveModelSerializers
|
||||
adapter = ActiveModelSerializers::Adapter::JsonApi.new(serializer)
|
||||
|
||||
assert_equal({
|
||||
reviews: { data: [
|
||||
{ type: 'comments', id: '1' },
|
||||
{ type: 'comments', id: '2' }
|
||||
] },
|
||||
reviews: { data: [{ type: 'comments', id: '1' },
|
||||
{ type: 'comments', id: '2' }] },
|
||||
writer: { data: { type: 'authors', id: '1' } },
|
||||
site: { data: { type: 'blogs', id: '1' } }
|
||||
}, adapter.serializable_hash[:data][:relationships])
|
||||
|
||||
@@ -47,7 +47,7 @@ module ActiveModel
|
||||
assert_equal(expected_type, hash.fetch(:data).fetch(:type))
|
||||
end
|
||||
|
||||
def with_jsonapi_resource_type inflection
|
||||
def with_jsonapi_resource_type(inflection)
|
||||
old_inflection = ActiveModelSerializers.config.jsonapi_resource_type
|
||||
ActiveModelSerializers.config.jsonapi_resource_type = inflection
|
||||
yield
|
||||
|
||||
@@ -20,4 +20,3 @@ module ActiveModelSerializers
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
Reference in New Issue
Block a user