Skip to content

Commit

Permalink
Intoduced new generic model class structure based on simple provider …
Browse files Browse the repository at this point in the history
…structure and DRYed up LDAP and Exchange sequences.
  • Loading branch information
thorsteneckel committed Jan 8, 2018
1 parent c3255f0 commit 1821c97
Show file tree
Hide file tree
Showing 6 changed files with 34 additions and 38 deletions.
2 changes: 1 addition & 1 deletion lib/sequencer/sequence/import/exchange/folder_contact.rb
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ def self.sequence
'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',
Expand Down
2 changes: 1 addition & 1 deletion lib/sequencer/sequence/import/ldap/users.rb
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ class Users < Sequencer::Sequence::Base

def self.sequence
[
'Import::Ldap::Users::StaticAttributes',
'Common::ModelClass::User',
'Import::Ldap::Users::ExternalSyncSource',
'Import::Common::ImportJob::DryRun',
'Import::Ldap::Users::DryRun::Payload',
Expand Down
22 changes: 22 additions & 0 deletions lib/sequencer/unit/common/model_class/base.rb
Original file line number Diff line number Diff line change
@@ -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 changes: 10 additions & 0 deletions lib/sequencer/unit/common/model_class/user.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
class Sequencer
class Unit
module Common
module ModelClass
class User < Sequencer::Unit::Common::ModelClass::Base
end
end
end
end
end

This file was deleted.

18 changes: 0 additions & 18 deletions lib/sequencer/unit/import/ldap/users/static_attributes.rb

This file was deleted.

0 comments on commit 1821c97

Please sign in to comment.