Method: Webhookdb::Replicator::Base#find_dependent

Defined in:
lib/webhookdb/replicator/base.rb

#find_dependent(service_name) ⇒ Webhookdb::ServiceIntegration?

Find a dependent service integration with the given service name. If none are found, return nil. If multiple are found, raise, as this should only be used for automatically managed integrations.



321
322
323
324
325
326
# File 'lib/webhookdb/replicator/base.rb', line 321

def find_dependent(service_name)
  sints = self.service_integration.dependents.filter { |si| si.service_name == service_name }
  raise Webhookdb::InvalidPrecondition, "there are multiple #{service_name} integrations in dependents" if
    sints.length > 1
  return sints.first
end