Properly adds relationships

This commit is contained in:
Muhammad Nawzad 2023-11-12 11:29:14 +03:00
parent 215c101c98
commit 159dfc5bc9
No known key found for this signature in database
GPG Key ID: B954B6AAE33940B2

View File

@ -60,9 +60,8 @@ module Schemable
properties: { properties: {
type: { type: :string, default: model_definition.model_name }, type: { type: :string, default: model_definition.model_name },
id: { type: :string }, id: { type: :string },
attributes: attributes_schema, attributes: attributes_schema
relationships: relationships_schema ? {} : relationships_schema }.merge!(relationships_schema.blank? ? {} : { relationships: relationships_schema })
}
}.compact_blank }.compact_blank
end end
end end