diff --git a/bridgetown-core/lib/bridgetown-core/resource/relations.rb b/bridgetown-core/lib/bridgetown-core/resource/relations.rb index 5a73389d6..4ecbcf822 100644 --- a/bridgetown-core/lib/bridgetown-core/resource/relations.rb +++ b/bridgetown-core/lib/bridgetown-core/resource/relations.rb @@ -20,7 +20,9 @@ def initialize(resource) # @return [HashWithDotAccess::Hash] def relation_schema - resource.collection.metadata.relations + @relation_schema ||= resource.collection.metadata.relations&.transform_values do |value| + value.is_a?(Array) ? value.map(&:to_s) : value.to_s + end end # @return [Array] diff --git a/bridgetown-core/test/test_relations.rb b/bridgetown-core/test/test_relations.rb index 901a0820c..13d36b463 100644 --- a/bridgetown-core/test/test_relations.rb +++ b/bridgetown-core/test/test_relations.rb @@ -13,9 +13,9 @@ class TestRelations < BridgetownUnitTest "has_many" => "posts", }, }, - "posts" => { - "relations" => { - "belongs_to" => "noodle", + posts: { + relations: { + belongs_to: :noodle, }, }, },