Class: RailsSimpleEventSourcing::EventsController

Inherits:
ApplicationController show all
Defined in:
app/controllers/rails_simple_event_sourcing/events_controller.rb

Instance Method Summary collapse

Instance Method Details

#indexObject



5
6
7
8
9
# File 'app/controllers/rails_simple_event_sourcing/events_controller.rb', line 5

def index
  @event_types = event_types
  @aggregates = aggregates
  paginate(search_events)
end

#showObject



11
12
13
14
15
16
17
# File 'app/controllers/rails_simple_event_sourcing/events_controller.rb', line 11

def show
  @event = Event.find(params[:id])
  @aggregate_state = @event.aggregate_state
  @payload_links         = AggregateLinksBuilder.new(@event.payload).call
  @aggregate_state_links = AggregateLinksBuilder.new(@aggregate_state).call
  find_adjacent_versions
end