Class: Arkaan::Event

Inherits:
Object
  • Object
show all
Includes:
Mongoid::Document, Mongoid::Timestamps
Defined in:
lib/arkaan/event.rb

Overview

An event is symbolizing a timestamped change in a model. It is recommended NOT to use this class directly but to use the Arkaan::Concerns::Historizable concern in a model.

Author:

Instance Attribute Summary collapse

Instance Attribute Details

#documentAny

Returns the model in which the history is embedded.

Returns:

  • (Any)

    the model in which the history is embedded



25
# File 'lib/arkaan/event.rb', line 25

embedded_in :document, polymorphic: true, inverse_of: :history

#fieldString

Returns the name of the field being historized.

Returns:

  • (String)

    the name of the field being historized



15
# File 'lib/arkaan/event.rb', line 15

field :field, type: String

#fromAny

Returns the value of the field before update.

Returns:

  • (Any)

    the value of the field before update



18
# File 'lib/arkaan/event.rb', line 18

field :from

#toAny

Returns the value of the field after update.

Returns:

  • (Any)

    the value of the field after update



21
# File 'lib/arkaan/event.rb', line 21

field :to