On Mon, Feb 13, 2012 at 5:48 AM, Chris Prather <ch...@prather.org> wrote:
> > What should that pack method look like? > > With the provision that I don't use Class::DBI ... and haven't in > anger in some time ... > Yes, it's all coming back to me now. :) > > It would I think look an awful lot like: sub pack { shift->_data_hash() } > That works if the CDBI object doesn't have any relationships. But, I don't think it works recursively. So, putting that in the CDBI base class results in JSON complaining: "...neither allow_blessed nor convert_blessed settings are enabled" because the "sub-objects" are not also converted to a hash. I guess another option is to use sub pack { shift->id } and then use coercion to re-inflate later by refetching from the database. Thanks, -- Bill Moseley mose...@hank.org