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