Carbonite.Query.changes

You're seeing just the function changes, go back to Carbonite.Query module for more information.
Link to this function

changes(record, opts \\ [])

View Source (since 0.2.0)

Specs

changes(record :: Ecto.Schema.t(), [changes_option()]) :: Ecto.Query.t()

Returns an Ecto.Query that can be used to select changes for a single record.

Given an Ecto.Schema struct, this function builds a query that fetches all changes recorded for it from the database, ordered ascending by their ID (i.e., roughly by insertion date descending).

Example

%MyApp.Rabbit{id: 1}
|> Carbonite.Query.changes()
|> MyApp.Repo.all()

Options

  • carbonite_prefix defines the audit trail's schema, defaults to "carbonite_default"
  • table_prefix allows to override the table prefix, defaults to schema prefix of the record
  • preload can be used to preload the transaction