Agile Web Development

Build it. Launch it. Love it.

Acts_as_trackable

English

Specify this act if you want to track changes of state of some model. This assumes there is an tracks table ready.

class Order < ActiveRecord::Base acts_as_trackable end

You can read the specs for in deep details.

Usage

  1. Install the plugin
  2. Run the generator ./script/generate trackablemigration addtrackable_table
  3. Rake db:migrate
  4. Declare any model acts_as_trackable

Espaņol

Usar este acts_as_trackable si deseas llevar el tracking de estado de un modelo.

Esto asume que la tabla tracks ya existe.

Ejemplo:

class Order < ActiveRecord::Base acts_as_trackable end

Uso

  1. Instala el plugin
  2. Ejecutar el generador ./script/generate trackablemigration agregartabla_trackable
  3. Rake db:migrate
  4. Declara algun modelo acts_as_trackable

Puedes leer los specs para ver mas detalles

Vitals

Home http://blogs.onrails.com.ar/plugins
Repository svn://svn.virtualizar.com.ar/projects/plugins/acts_as_trackable/
License Rails' (MIT)
Tags Tag_red state track tracking
Rating (3 votes)
Owner Pedro Visintin
Created 3 June 2007

Comments

  • Avatar
    Brandon Keene
    7 June 2007

    While this plugin is fully compatible with actsas_statemachine there is one gotcha to be aware of.

    The callback order creates a problem where the initial state is not saved but rather nil is saved as the first Track.

    In lib/acts_as_trackable.rb...

    A simple patch is to update the line: beforesave :trackit

    to: aftersave :trackit

    This is because actsas_statemachine's initial state is saved via beforecreate which is executed *after* beforesave resulting in the nil state.

  • Avatar
    8 June 2007

    You are right, aftersave is the optimal callback for actsasstatemachine works perfect. Patched! :-)

  • Avatar
    Ramon
    12 March 2008

    It seems to be down :( This is the exact thing I was looking for. I get this:

    svn: No repository found in 'svn://svn.virtualizar.com.ar/projects/plugins/acts_as_trackable'

Add a comment