From fdc48df8a2d51680826dc1f16ce161ec4dcab663 Mon Sep 17 00:00:00 2001 From: Andrew Manley Date: Thu, 6 Jun 2024 18:36:49 -0600 Subject: [PATCH] Add restricted value to page serializer --- app/serializers/alchemy/json_api/page_serializer.rb | 3 ++- spec/serializers/alchemy/json_api/page_serializer_spec.rb | 1 + 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/app/serializers/alchemy/json_api/page_serializer.rb b/app/serializers/alchemy/json_api/page_serializer.rb index 8d6f962..7015f54 100644 --- a/app/serializers/alchemy/json_api/page_serializer.rb +++ b/app/serializers/alchemy/json_api/page_serializer.rb @@ -15,7 +15,8 @@ class PageSerializer < BaseSerializer :meta_keywords, :meta_description, :created_at, - :updated_at + :updated_at, + :restricted ) cache_options store: Rails.cache, namespace: "alchemy-jsonapi" diff --git a/spec/serializers/alchemy/json_api/page_serializer_spec.rb b/spec/serializers/alchemy/json_api/page_serializer_spec.rb index cbc3d45..bf6eef6 100644 --- a/spec/serializers/alchemy/json_api/page_serializer_spec.rb +++ b/spec/serializers/alchemy/json_api/page_serializer_spec.rb @@ -36,6 +36,7 @@ expect(attributes[:created_at]).to eq(page.created_at) expect(attributes[:updated_at]).to eq(page.updated_at) expect(attributes[:legacy_urls]).to eq(["/other"]) + expect(attributes[:restricted]).to be false expect(attributes.keys).not_to include(:tag_list, :status) end end