Sha256: 16f919a6825910aa023a10ed74556f64e7e7cec73fe07e7a66efab00ea5c9d40

Contents?: true

Size: 1.07 KB

Versions: 50

Compression:

Stored size: 1.07 KB

Contents

module Maestrano::Connector::Rails::Concerns::EntityBase
  extend ActiveSupport::Concern

  def initialize(organization, connec_client, external_client, opts = {})
    @organization = organization
    @connec_client = connec_client
    @external_client = external_client
    @opts = opts
  end

  def opts_merge!(opts)
    @opts.merge!(opts)
  end

  def before_sync(last_synchronization_date)
    # Does nothing by default
  end

  def after_sync(last_synchronization_date)
    # Does nothing by default
  end

  # This method is called during the webhook workflow only. It should return the hash of arrays of filtered entities
  # The aim is to have the same filtering as with the Connec! filters on API calls in the webhooks
  # input :
  # For non complex entities [unmapped_external_entity1, unmapped_external_entity2]
  # For complex entities {
  #   external_entities_names[0]: [unmapped_external_entity1, unmapped_external_entity2],
  #   external_entities_names[1]: [unmapped_external_entity3, unmapped_external_entity4]
  # }
  def filter_connec_entities(entities)
    entities
  end
end

Version data entries

50 entries across 50 versions & 1 rubygems

Version Path
maestrano-connector-rails-2.3.6 app/models/maestrano/connector/rails/concerns/entity_base.rb
maestrano-connector-rails-2.3.5 app/models/maestrano/connector/rails/concerns/entity_base.rb
maestrano-connector-rails-2.3.4 app/models/maestrano/connector/rails/concerns/entity_base.rb
maestrano-connector-rails-2.3.3 app/models/maestrano/connector/rails/concerns/entity_base.rb
maestrano-connector-rails-2.3.2 app/models/maestrano/connector/rails/concerns/entity_base.rb
maestrano-connector-rails-2.3.1 app/models/maestrano/connector/rails/concerns/entity_base.rb
maestrano-connector-rails-2.3.0 app/models/maestrano/connector/rails/concerns/entity_base.rb
maestrano-connector-rails-2.2.1 app/models/maestrano/connector/rails/concerns/entity_base.rb
maestrano-connector-rails-2.2.0 app/models/maestrano/connector/rails/concerns/entity_base.rb
maestrano-connector-rails-2.1.3 app/models/maestrano/connector/rails/concerns/entity_base.rb
maestrano-connector-rails-2.1.2 app/models/maestrano/connector/rails/concerns/entity_base.rb
maestrano-connector-rails-2.1.1 app/models/maestrano/connector/rails/concerns/entity_base.rb
maestrano-connector-rails-2.1.0 app/models/maestrano/connector/rails/concerns/entity_base.rb
maestrano-connector-rails-2.0.2.pre.RC12 app/models/maestrano/connector/rails/concerns/entity_base.rb
maestrano-connector-rails-2.0.2.pre.RC11 app/models/maestrano/connector/rails/concerns/entity_base.rb
maestrano-connector-rails-2.0.2.pre.RC10 app/models/maestrano/connector/rails/concerns/entity_base.rb
maestrano-connector-rails-2.0.2.pre.RC8 app/models/maestrano/connector/rails/concerns/entity_base.rb
maestrano-connector-rails-2.0.2.pre.RC9 app/models/maestrano/connector/rails/concerns/entity_base.rb
maestrano-connector-rails-2.0.2.pre.RC7 app/models/maestrano/connector/rails/concerns/entity_base.rb
maestrano-connector-rails-2.0.2.pre.RC6 app/models/maestrano/connector/rails/concerns/entity_base.rb