Intoduced new generic model class structure based on simple provider structure and DRYed up LDAP and Exchange sequences.

This commit is contained in:
Thorsten Eckel 2017-12-20 16:29:39 +01:00
parent c3255f0018
commit 1821c97506
6 changed files with 34 additions and 38 deletions

View file

@ -9,7 +9,7 @@ class Sequencer
'Import::Exchange::FolderContact::RemoteId',
'Import::Exchange::FolderContact::Mapping',
'Import::Common::Model::Skip::Blank::Mapped',
'Import::Exchange::FolderContact::StaticAttributes',
'Common::ModelClass::User',
'Import::Exchange::FolderContact::ExternalSyncSource',
'Import::Common::Model::Lookup::ExternalSync',
'Import::Common::Model::Associations::Extract',

View file

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

View file

@ -0,0 +1,22 @@
class Sequencer
class Unit
module Common
module ModelClass
class Base < Sequencer::Unit::Common::Provider::Attribute
provides :model_class
private
def model_class
@model_class ||= class_name.constantize
end
def class_name
self.class.name.sub('Sequencer::Unit::Common::ModelClass', '')
end
end
end
end
end
end

View file

@ -0,0 +1,10 @@
class Sequencer
class Unit
module Common
module ModelClass
class User < Sequencer::Unit::Common::ModelClass::Base
end
end
end
end
end

View file

@ -1,18 +0,0 @@
class Sequencer
class Unit
module Import
module Exchange
module FolderContact
class StaticAttributes < Sequencer::Unit::Base
provides :model_class
def process
state.provide(:model_class, ::User)
end
end
end
end
end
end
end

View file

@ -1,18 +0,0 @@
class Sequencer
class Unit
module Import
module Ldap
module Users
class StaticAttributes < Sequencer::Unit::Base
provides :model_class
def process
state.provide(:model_class, ::User)
end
end
end
end
end
end
end