Links
Acts_as_trackable
Categories
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
- 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
Vitals
| Home | http://blogs.onrails.com.ar/plugins |
|---|---|
| Repository | svn://svn.virtualizar.com.ar/projects/plugins/acts_as_trackable/ |
| License | Rails' (MIT) |
| Tags |
state track tracking
|
| Rating | (3 votes) |
| Owner | Pedro Visintin |
| Created | 3 June 2007 |
Comments
-
While this plugin is fully compatible with acts_as_state_machine 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: before_save :track_it
to: after_save :track_it
This is because acts_as_state_machine's initial state is saved via before_create which is executed after before_save resulting in the nil state.
-
You are right, after_save is the optimal callback for acts_as_state_machine works perfect. Patched! :-)
-
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'

