Plugins - Acts_as_trackable

StarAdd to favorites

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

Pedro Visintin

http://blogs.onrails.com.ar/plugins

svn://svn.virtualizar.com.ar/projects/plugins/acts_as_trackable/

Rails' (MIT)

  • Currently 4.7/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5

Model

Tags

Comments

Add a comment
Ramon 12 Mar 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'

Peterpunk 8 Jun 2007

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

Brandon Keene 7 Jun 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.

Search Plugins

Query syntax

Plugins by Category

Sponsors

Rails Kits: Get Code. Get Moving.

Have a comment?