Plugins - Acts_as_trackable
Add to favoritesEnglish
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
- Install the plugin
- Run the generator ./script/generate trackablemigration addtrackable_table
- Rake db:migrate
- 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
- Instala el plugin
- Ejecutar el generador ./script/generate trackablemigration agregartabla_trackable
- Rake db:migrate
- Declara algun modelo acts_as_trackable
Puedes leer los specs para ver mas detalles
http://blogs.onrails.com.ar/plugins
svn://svn.virtualizar.com.ar/projects/plugins/acts_as_trackable/
Rails' (MIT)
Model

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'
You are right, aftersave is the optimal callback for actsasstatemachine works perfect. Patched! :-)
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.