|
|
|
|
|
by inopinatus
3492 days ago
|
|
Cool idea. How did you resist the temptation to call it temptation? Although I think temptable is almost the opposite of contemptible, therefore also good going in the pun department. My code is all Ruby, and I ended up pushing all the work into SQL and just eventually selecting with find_by_sql into existing models for the results. There is possibly concurrent invocation vs updates and a race against itself, so it's also all wrapped with a serializable transaction and starts with a mutex lock on the controlling model. |
|
The approach I went with works really well for cases when you want to persist the temporary table through the end of the request (it works good for master/index type views that may have a lot of sums/counts and filter options available on it).