Commit fa67efe6 authored by Yorick Peterse's avatar Yorick Peterse

Move EE prepend/include to the end of presenters

This moves all instances of `prepend EE::Something` and `include
EE::Something` in presenters to the last line of the corresponding file.
This pushes EE specific code further down the files, reducing the
likelihood of developers running into merge conflicts.
parent 43daa7c8
# frozen_string_literal: true # frozen_string_literal: true
class GroupMemberPresenter < MemberPresenter class GroupMemberPresenter < MemberPresenter
prepend EE::GroupMemberPresenter
private private
def admin_member_permission def admin_member_permission
...@@ -17,3 +15,5 @@ class GroupMemberPresenter < MemberPresenter ...@@ -17,3 +15,5 @@ class GroupMemberPresenter < MemberPresenter
:destroy_group_member :destroy_group_member
end end
end end
GroupMemberPresenter.prepend(EE::GroupMemberPresenter)
# frozen_string_literal: true # frozen_string_literal: true
class MemberPresenter < Gitlab::View::Presenter::Delegated class MemberPresenter < Gitlab::View::Presenter::Delegated
prepend EE::MemberPresenter
presents :member presents :member
def access_level_roles def access_level_roles
...@@ -40,3 +38,5 @@ class MemberPresenter < Gitlab::View::Presenter::Delegated ...@@ -40,3 +38,5 @@ class MemberPresenter < Gitlab::View::Presenter::Delegated
raise NotImplementedError raise NotImplementedError
end end
end end
MemberPresenter.prepend(EE::MemberPresenter)
# frozen_string_literal: true # frozen_string_literal: true
class MergeRequestPresenter < Gitlab::View::Presenter::Delegated class MergeRequestPresenter < Gitlab::View::Presenter::Delegated
prepend EE::MergeRequestPresenter
include ActionView::Helpers::UrlHelper include ActionView::Helpers::UrlHelper
include GitlabRoutingHelper include GitlabRoutingHelper
include MarkupHelper include MarkupHelper
...@@ -225,3 +223,5 @@ class MergeRequestPresenter < Gitlab::View::Presenter::Delegated ...@@ -225,3 +223,5 @@ class MergeRequestPresenter < Gitlab::View::Presenter::Delegated
can?(current_user, :fork_project, project) can?(current_user, :fork_project, project)
end end
end end
MergeRequestPresenter.prepend(EE::MergeRequestPresenter)
# frozen_string_literal: true # frozen_string_literal: true
class ProjectMemberPresenter < MemberPresenter class ProjectMemberPresenter < MemberPresenter
prepend EE::ProjectMemberPresenter
private private
def admin_member_permission def admin_member_permission
...@@ -17,3 +15,5 @@ class ProjectMemberPresenter < MemberPresenter ...@@ -17,3 +15,5 @@ class ProjectMemberPresenter < MemberPresenter
:destroy_project_member :destroy_project_member
end end
end end
ProjectMemberPresenter.prepend(EE::ProjectMemberPresenter)
# frozen_string_literal: true # frozen_string_literal: true
class ProjectPresenter < Gitlab::View::Presenter::Delegated class ProjectPresenter < Gitlab::View::Presenter::Delegated
prepend EE::ProjectPresenter
include ActionView::Helpers::NumberHelper include ActionView::Helpers::NumberHelper
include ActionView::Helpers::UrlHelper include ActionView::Helpers::UrlHelper
include GitlabRoutingHelper include GitlabRoutingHelper
...@@ -320,3 +318,5 @@ class ProjectPresenter < Gitlab::View::Presenter::Delegated ...@@ -320,3 +318,5 @@ class ProjectPresenter < Gitlab::View::Presenter::Delegated
) )
end end
end end
ProjectPresenter.prepend(EE::ProjectPresenter)
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