Exception: Funes::UnknownMaterializationModel

Inherits:
StandardError
  • Object
show all
Defined in:
lib/funes/unknown_materialization_model.rb

Overview

Raised when attempting to materialize a projection without a configured materialization model.

Projections require a materialization model (ActiveModel or ActiveRecord class) to be configured via materialization_model before they can be materialized or persisted. This error occurs when calling materialize! on a projection that hasn't been properly configured.

Examples:

Projection without materialization model (raises error)

class IncompleteProjection < Funes::Projection
  interpretation_for OrderPlaced do |state, event, as_of|
    # ...
  end
  # Missing: materialization_model SomeModel
end

# This will raise Funes::UnknownMaterializationModel
IncompleteProjection.materialize!(events, "entity-123", Time.current)

Properly configured projection

class OrderProjection < Funes::Projection
  materialization_model OrderSnapshot

  interpretation_for OrderPlaced do |state, event, as_of|
    # ...
  end
end