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 ...@@ -11,14 +11,14 @@ class Groups::Analytics::CycleAnalytics::ValueStreamsController < Analytics::App
end end
def index def index
render json: Analytics::GroupValueStreamSerializer.new.represent(value_streams) render json: Analytics::CycleAnalytics::GroupValueStreamSerializer.new.represent(value_streams)
end end
def create def create
value_stream = @group.value_streams.build(value_stream_params) value_stream = @group.value_streams.build(value_stream_params)
if value_stream.save if value_stream.save
render json: Analytics::GroupValueStreamSerializer.new.represent(value_stream) render json: Analytics::CycleAnalytics::GroupValueStreamSerializer.new.represent(value_stream)
else else
render json: { message: 'Invalid parameters', payload: { errors: value_stream.errors } }, status: :unprocessable_entity render json: { message: 'Invalid parameters', payload: { errors: value_stream.errors } }, status: :unprocessable_entity
end end
......
# frozen_string_literal: true # frozen_string_literal: true
module Analytics module Analytics
class GroupValueStreamEntity < Grape::Entity module CycleAnalytics
expose :name class GroupValueStreamEntity < Grape::Entity
expose :id expose :name
expose :is_custom do |object| expose :id
object.custom? expose :is_custom do |object|
end object.custom?
end
private private
def id def id
object.id || object.name # use the name `default` if the record is not persisted object.id || object.name # use the name `default` if the record is not persisted
end
end end
end end
end end
# frozen_string_literal: true # frozen_string_literal: true
module Analytics module Analytics
class GroupValueStreamSerializer < BaseSerializer module CycleAnalytics
entity ::Analytics::GroupValueStreamEntity class GroupValueStreamSerializer < BaseSerializer
entity ::Analytics::CycleAnalytics::GroupValueStreamEntity
end
end 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