Migrated multi-purpose Units (antipattern) to new simple provider structure.

This commit is contained in:
Thorsten Eckel 2017-12-20 16:25:03 +01:00
parent 5a6f3f1a38
commit c3255f0018
6 changed files with 37 additions and 4 deletions

View file

@ -10,6 +10,7 @@ class Sequencer
'Import::Exchange::FolderContact::Mapping',
'Import::Common::Model::Skip::Blank::Mapped',
'Import::Exchange::FolderContact::StaticAttributes',
'Import::Exchange::FolderContact::ExternalSyncSource',
'Import::Common::Model::Lookup::ExternalSync',
'Import::Common::Model::Associations::Extract',
'Import::Common::User::Attributes::Downcase',

View file

@ -7,6 +7,7 @@ class Sequencer
def self.sequence
[
'Import::Ldap::Users::StaticAttributes',
'Import::Ldap::Users::ExternalSyncSource',
'Import::Common::ImportJob::DryRun',
'Import::Ldap::Users::DryRun::Payload',
'Ldap::Config',

View file

@ -0,0 +1,16 @@
class Sequencer
class Unit
module Import
module Exchange
module FolderContact
class ExternalSyncSource < Sequencer::Unit::Common::Provider::Named
def external_sync_source
'Exchange::FolderContact'
end
end
end
end
end
end
end

View file

@ -5,11 +5,10 @@ class Sequencer
module FolderContact
class StaticAttributes < Sequencer::Unit::Base
provides :model_class, :external_sync_source
provides :model_class
def process
state.provide(:model_class, ::User)
state.provide(:external_sync_source, 'Exchange::FolderContact')
end
end
end

View file

@ -0,0 +1,16 @@
class Sequencer
class Unit
module Import
module Ldap
module Users
class ExternalSyncSource < Sequencer::Unit::Common::Provider::Named
def external_sync_source
'Ldap::User'
end
end
end
end
end
end
end

View file

@ -4,11 +4,11 @@ class Sequencer
module Ldap
module Users
class StaticAttributes < Sequencer::Unit::Base
provides :model_class, :external_sync_source
provides :model_class
def process
state.provide(:model_class, ::User)
state.provide(:external_sync_source, 'Ldap::User')
end
end
end