Migrated multi-purpose Units (antipattern) to new simple provider structure.
This commit is contained in:
parent
5a6f3f1a38
commit
c3255f0018
6 changed files with 37 additions and 4 deletions
|
@ -10,6 +10,7 @@ class Sequencer
|
||||||
'Import::Exchange::FolderContact::Mapping',
|
'Import::Exchange::FolderContact::Mapping',
|
||||||
'Import::Common::Model::Skip::Blank::Mapped',
|
'Import::Common::Model::Skip::Blank::Mapped',
|
||||||
'Import::Exchange::FolderContact::StaticAttributes',
|
'Import::Exchange::FolderContact::StaticAttributes',
|
||||||
|
'Import::Exchange::FolderContact::ExternalSyncSource',
|
||||||
'Import::Common::Model::Lookup::ExternalSync',
|
'Import::Common::Model::Lookup::ExternalSync',
|
||||||
'Import::Common::Model::Associations::Extract',
|
'Import::Common::Model::Associations::Extract',
|
||||||
'Import::Common::User::Attributes::Downcase',
|
'Import::Common::User::Attributes::Downcase',
|
||||||
|
|
|
@ -7,6 +7,7 @@ class Sequencer
|
||||||
def self.sequence
|
def self.sequence
|
||||||
[
|
[
|
||||||
'Import::Ldap::Users::StaticAttributes',
|
'Import::Ldap::Users::StaticAttributes',
|
||||||
|
'Import::Ldap::Users::ExternalSyncSource',
|
||||||
'Import::Common::ImportJob::DryRun',
|
'Import::Common::ImportJob::DryRun',
|
||||||
'Import::Ldap::Users::DryRun::Payload',
|
'Import::Ldap::Users::DryRun::Payload',
|
||||||
'Ldap::Config',
|
'Ldap::Config',
|
||||||
|
|
|
@ -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
|
|
@ -5,11 +5,10 @@ class Sequencer
|
||||||
module FolderContact
|
module FolderContact
|
||||||
class StaticAttributes < Sequencer::Unit::Base
|
class StaticAttributes < Sequencer::Unit::Base
|
||||||
|
|
||||||
provides :model_class, :external_sync_source
|
provides :model_class
|
||||||
|
|
||||||
def process
|
def process
|
||||||
state.provide(:model_class, ::User)
|
state.provide(:model_class, ::User)
|
||||||
state.provide(:external_sync_source, 'Exchange::FolderContact')
|
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
16
lib/sequencer/unit/import/ldap/users/external_sync_source.rb
Normal file
16
lib/sequencer/unit/import/ldap/users/external_sync_source.rb
Normal 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
|
|
@ -4,11 +4,11 @@ class Sequencer
|
||||||
module Ldap
|
module Ldap
|
||||||
module Users
|
module Users
|
||||||
class StaticAttributes < Sequencer::Unit::Base
|
class StaticAttributes < Sequencer::Unit::Base
|
||||||
provides :model_class, :external_sync_source
|
|
||||||
|
provides :model_class
|
||||||
|
|
||||||
def process
|
def process
|
||||||
state.provide(:model_class, ::User)
|
state.provide(:model_class, ::User)
|
||||||
state.provide(:external_sync_source, 'Ldap::User')
|
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in a new issue