Commit 4e6b9747 authored by allison.browne's avatar allison.browne

Add namespacing to Variable Serializers

VariableSerializer -> ::Ci::VariableSerializer
GroupVariableSerializer -> ::Ci::GroupVariableSerializer
VariableEntity -> ::Ci::VariableEntity
GroupVariableEntity -> ::Ci::GroupVariableEntity
parent 690a4269
......@@ -9,7 +9,7 @@ module Groups
def show
respond_to do |format|
format.json do
render status: :ok, json: { variables: GroupVariableSerializer.new.represent(@group.variables) }
render status: :ok, json: { variables: ::Ci::GroupVariableSerializer.new.represent(@group.variables) }
end
end
end
......@@ -29,7 +29,7 @@ module Groups
private
def render_group_variables
render status: :ok, json: { variables: GroupVariableSerializer.new.represent(@group.variables) }
render status: :ok, json: { variables: ::Ci::GroupVariableSerializer.new.represent(@group.variables) }
end
def render_error
......
......@@ -6,7 +6,7 @@ class Projects::VariablesController < Projects::ApplicationController
def show
respond_to do |format|
format.json do
render status: :ok, json: { variables: VariableSerializer.new.represent(@project.variables) }
render status: :ok, json: { variables: ::Ci::VariableSerializer.new.represent(@project.variables) }
end
end
end
......@@ -26,7 +26,7 @@ class Projects::VariablesController < Projects::ApplicationController
private
def render_variables
render status: :ok, json: { variables: VariableSerializer.new.represent(@project.variables) }
render status: :ok, json: { variables: ::Ci::VariableSerializer.new.represent(@project.variables) }
end
def render_error
......
# frozen_string_literal: true
class GroupVariableEntity < Ci::BasicVariableEntity
module Ci
class GroupVariableEntity < Ci::BasicVariableEntity
end
end
# frozen_string_literal: true
class GroupVariableSerializer < BaseSerializer
entity GroupVariableEntity
module Ci
class GroupVariableSerializer < BaseSerializer
entity ::Ci::GroupVariableEntity
end
end
# frozen_string_literal: true
class VariableEntity < Ci::BasicVariableEntity
module Ci
class VariableEntity < Ci::BasicVariableEntity
expose :environment_scope
end
end
# frozen_string_literal: true
class VariableSerializer < BaseSerializer
entity VariableEntity
module Ci
class VariableSerializer < BaseSerializer
entity ::Ci::VariableEntity
end
end
......@@ -2,7 +2,7 @@
require 'spec_helper'
RSpec.describe GroupVariableEntity do
RSpec.describe Ci::GroupVariableEntity do
let(:variable) { create(:ci_group_variable) }
let(:entity) { described_class.new(variable) }
......
......@@ -2,7 +2,7 @@
require 'spec_helper'
RSpec.describe VariableEntity do
RSpec.describe Ci::VariableEntity do
let(:variable) { create(:ci_variable) }
let(:entity) { described_class.new(variable) }
......
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