Latest additions to DBIC::Helpers

Yesterday I added a basic but really nice helper to DBIx::Class::Helpers. Say hello to DBIx::Class::Helper::Row::NumifyGet. The reasoning is that often we have bit fields in our database and when we serialize them with JSON we get something like the following:

{ 'bit_field':'0'}

JavaScript has the whole truthy concept like Perl except that in JavaScript “0” is true, while 0 is false. So NumifyGet will automatically “numify” columns with the is_numeric field set to true. After doing that the json above would become:

{ 'bit_field':0}

Much nicer. Also I added some good docs to DBIx::Class::Helper::ResultSet::Union as well as fixing some latent bugs that were in it.


Posted Thu, Jan 14, 2010