Intoduced new generic model class structure based on simple provider structure and DRYed up LDAP and Exchange sequences.
This commit is contained in:
parent
c3255f0018
commit
1821c97506
6 changed files with 34 additions and 38 deletions
|
@ -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',
|
||||
|
|
|
@ -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',
|
||||
|
|
22
lib/sequencer/unit/common/model_class/base.rb
Normal file
22
lib/sequencer/unit/common/model_class/base.rb
Normal 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
|
10
lib/sequencer/unit/common/model_class/user.rb
Normal file
10
lib/sequencer/unit/common/model_class/user.rb
Normal 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
|
|
@ -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
|
|
@ -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
|
Loading…
Reference in a new issue