On Mar 16, 2:43 pm, Eric Pugh <[email protected]> wrote: > I did the horrible hack of changing the mysql.rb to be this: > > # Convert the type of v using the method in MYSQL_TYPES[type]. > def convert_type(v, type) > if v > if type == 1 && Sequel.convert_tinyint_to_bool > # We special case tinyint here to avoid adding > # a method to an ancestor of Fixnum > v.to_i == 0 ? false : true > else > if v == '0000-00-00 00:00:00' or v == '0000-00-00' then > nil > else > (t = MYSQL_TYPES[type]) ? v.send(t) : v > end > end > else > nil > end > end > > But of course, would like something better that doesn't require > hacking the gem!
This question has come up in the past, so you could search the archives. It's actually a smaller change with the current master branch, you should only have to modify 3 lines inside the MYSQL_TYPE_PROCS hash. I don't think Sequel should convert bogus dates to nil automatically, but I suppose I could consider a patch that made it optional, similar to some of the PostgreSQL specific options. If you want to work on a patch against the master branch that makes this conversion optional, I'd consider it. Thanks, Jeremy --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "sequel-talk" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/sequel-talk?hl=en -~----------~----~----~----~------~----~------~--~---
