UnionOfRAD/lithium — pull request #652 by jails (2012-09-21 16:42:00+00:00)
Title: Refactoring lazy initialization for model metadata

Hi nate, I saw you have already implemented the lazy initialization for model metadata, sorry for the delay.
In this PR you will find my acutal "state" for this subject (from your implementation).
Using $_meta in closures is imo not safe since $_meta may contains in the same time initialized and not yet initialized metadata. Since the initialization is done lazily the order of initialization may produce different results. I also updated the autoConfig and added some tests.

Example of use :
```
Posts::config(array(
'initializers' => array(
'source' => function($self) {
return 'custom_' . Inflector::underscore($self::meta('name'));
},
'name' => function($self) {
return Inflector::singularize(basename(str_replace('\\', '/', $self)));
}
)
));
```