Commit 17523afb authored by Adam Hegyi's avatar Adam Hegyi

Fix missing module in VSA serializers

This change adds the missing CycleAnalytics namespace for the value
stream analytics (former cycle analytics) serializers to prevent code
reloading errors in development.
parent c909c0ec
......@@ -11,14 +11,14 @@ class Groups::Analytics::CycleAnalytics::ValueStreamsController < Analytics::App
end
def index
render json: Analytics::GroupValueStreamSerializer.new.represent(value_streams)
render json: Analytics::CycleAnalytics::GroupValueStreamSerializer.new.represent(value_streams)
end
def create
value_stream = @group.value_streams.build(value_stream_params)
if value_stream.save
render json: Analytics::GroupValueStreamSerializer.new.represent(value_stream)
render json: Analytics::CycleAnalytics::GroupValueStreamSerializer.new.represent(value_stream)
else
render json: { message: 'Invalid parameters', payload: { errors: value_stream.errors } }, status: :unprocessable_entity
end
......
# frozen_string_literal: true
module Analytics
class GroupValueStreamEntity < Grape::Entity
expose :name
expose :id
expose :is_custom do |object|
object.custom?
end
module CycleAnalytics
class GroupValueStreamEntity < Grape::Entity
expose :name
expose :id
expose :is_custom do |object|
object.custom?
end
private
private
def id
object.id || object.name # use the name `default` if the record is not persisted
def id
object.id || object.name # use the name `default` if the record is not persisted
end
end
end
end
# frozen_string_literal: true
module Analytics
class GroupValueStreamSerializer < BaseSerializer
entity ::Analytics::GroupValueStreamEntity
module CycleAnalytics
class GroupValueStreamSerializer < BaseSerializer
entity ::Analytics::CycleAnalytics::GroupValueStreamEntity
end
end
end
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment