From 27dd0b8e3609aae92b8e59dd202a999fc1db5a4e Mon Sep 17 00:00:00 2001 From: charlieablett Date: Thu, 6 Jun 2019 20:13:18 +1200 Subject: Use serialization for project boards - Add serializers and Grape::Entity - Replace to_json - Add specs --- app/serializers/board_serializer.rb | 5 +++++ app/serializers/board_simple_entity.rb | 5 +++++ 2 files changed, 10 insertions(+) create mode 100644 app/serializers/board_serializer.rb create mode 100644 app/serializers/board_simple_entity.rb (limited to 'app/serializers') diff --git a/app/serializers/board_serializer.rb b/app/serializers/board_serializer.rb new file mode 100644 index 00000000000..70a4c9ae282 --- /dev/null +++ b/app/serializers/board_serializer.rb @@ -0,0 +1,5 @@ +# frozen_string_literal: true + +class BoardSerializer < BaseSerializer + entity BoardSimpleEntity +end diff --git a/app/serializers/board_simple_entity.rb b/app/serializers/board_simple_entity.rb new file mode 100644 index 00000000000..f297d993e27 --- /dev/null +++ b/app/serializers/board_simple_entity.rb @@ -0,0 +1,5 @@ +# frozen_string_literal: true + +class BoardSimpleEntity < Grape::Entity + expose :id +end -- cgit v1.2.1