Commit ee0cd772 authored by Winnie Hellmann's avatar Winnie Hellmann

Remove prepend_entity from EE::API::Entities

parent c14f85fb
......@@ -3,24 +3,6 @@
module EE
module API
module Entities
#######################
# Entities extensions #
#######################
module Entities
extend ActiveSupport::Concern
class_methods do
def prepend_entity(klass, with: nil)
if with.nil?
raise ArgumentError, 'You need to pass either the :with or :namespace option!'
end
klass.descendants.each { |descendant| descendant.prepend(with) }
klass.prepend(with)
end
end
end
module EntityHelpers
def can_read(attr, &block)
->(obj, opts) { Ability.allowed?(opts[:user], "read_#{attr}".to_sym, yield(obj)) }
......
......@@ -1725,7 +1725,6 @@ module API
end
# rubocop: disable Cop/InjectEnterpriseEditionModule
API::Entities.prepend_if_ee('EE::API::Entities::Entities')
::API::Entities::ApplicationSetting.prepend_if_ee('EE::API::Entities::ApplicationSetting')
::API::Entities::Board.prepend_if_ee('EE::API::Entities::Board')
::API::Entities::Group.prepend_if_ee('EE::API::Entities::Group', with_descendants: true)
......
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