Links
meantime_filter
Categories
meantime_filter
This plugin introduces a new filter type to ActionController::Base: meantime filters. They are called at the time of the action call just after before filters. They allow to do things around the action by yielding when the action has to be performed. This enables the action to be executed within the block of any method.
I have written this plugin because I needed to scope an ActiveRecord model during the actions I specify with its with_scope class method that takes a block and it was not possible to reproduce its behaviour with before and after filters since there is no method to scope without a block and no method to remove the last scope.
With meantime filters, it’s possible to do such things in a simple and clean manner.
I think it is a better way to do things both before and after actions than using an around filter because yield is made for that type of task.
Vitals
| Home | http://roman2k.free.fr/rails/meantime_filter/0.1.1/rdoc/ |
|---|---|
| License | |
| Tags |
activerecord filter scope
|
| Rating | (8 votes) |
| Owner | Roman Le Negrate |
| Created | 3 July 2006 |

