Commit 5d7b6be4 authored by Robert Speicher's avatar Robert Speicher

Merge branch '207480-move-all-ci-files-under-ci-namespace' into 'master'

Move variable serializers under `Ci::` namespace"

See merge request gitlab-org/gitlab!36636
parents 161f25af 4e6b9747
......@@ -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
module Ci
class GroupVariableSerializer < BaseSerializer
entity ::Ci::GroupVariableEntity
end
end
# frozen_string_literal: true
module Ci
class VariableEntity < Ci::BasicVariableEntity
expose :environment_scope
end
end
# frozen_string_literal: true
module Ci
class VariableSerializer < BaseSerializer
entity ::Ci::VariableEntity
end
end
# frozen_string_literal: true
class GroupVariableSerializer < BaseSerializer
entity GroupVariableEntity
end
# frozen_string_literal: true
class VariableEntity < Ci::BasicVariableEntity
expose :environment_scope
end
# frozen_string_literal: true
class VariableSerializer < BaseSerializer
entity VariableEntity
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