[Solar-talk] _PostCreate _autoCreate ver0.25 ver0.26?

Rodrigo Moraes rodrigo.moraes at gmail.com
Mon Feb 5 10:40:05 PST 2007


On 2/5/07, Jeff Surgeson wrote:
> > Which has the same effect: the table doesn't exist; the fetch is only
> > called to trigger _connect() and create it.
>
> Thanks, I currently don't need to so will leave it as it is however will make
> notes of these two ways so when I need to I know how.

Don't make a note about mine. I do the 'fake' fetch() in a separated
bootstrap with the only intention to create the tables (it's a dirty
dirty hack).

But I was thinking on this subject and actually I will implement on my
models the call to _connect() in the constructor when 'create' is
true. This is borrowed from Antti's solution, only it uses an existing
config key. When initializing tables, turn 'create' on and you just
need to construct the model to have the table created. Then turn it
off back. :)

rodrigo
-------------------------------
http://tipos.com.br


More information about the solar-talk mailing list