2017-11-29 16:54:52 +00:00
|
|
|
class Sequencer
|
|
|
|
class Unit
|
|
|
|
module Import
|
|
|
|
module Ldap
|
|
|
|
module User
|
|
|
|
module Lookup
|
2018-01-12 12:38:43 +00:00
|
|
|
class Attributes < Sequencer::Unit::Import::Common::Model::FindBy::UserAttributes
|
|
|
|
|
|
|
|
uses :found_ids, :external_sync_source
|
|
|
|
|
2017-11-29 16:54:52 +00:00
|
|
|
private
|
|
|
|
|
2018-01-12 12:38:43 +00:00
|
|
|
def lookup(attribute:, value:)
|
|
|
|
entries = model_class.where(attribute => value).to_a
|
|
|
|
return if entries.blank?
|
|
|
|
not_synced(entries)
|
|
|
|
end
|
|
|
|
|
|
|
|
def not_synced(entries)
|
|
|
|
entries.find(&method(:not_synced?))
|
|
|
|
end
|
|
|
|
|
|
|
|
def not_synced?(entry)
|
|
|
|
found_ids.exclude?(entry.id)
|
2017-11-29 16:54:52 +00:00
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|