Method: ActiveProjection::ProjectionRepository.ensure_exists

Defined in:
app/models/active_projection/projection_repository.rb

.ensure_exists(projection_class) ⇒ Object



27
28
29
30
31
# File 'app/models/active_projection/projection_repository.rb', line 27

def self.ensure_exists(projection_class)
  Projection.transaction do
    Projection.find_or_create_by! class_name: projection_class
  end
end