Why is it a bad idea? Writing a new type is easy: http://cookbook.hobocentral.net/recipes/1-add-your-own-rich-type
This is a perfect case of using a custom type should be used: none of the existing types correspond to the required behavior. Bye! François On 9 sep, 14:25, Joachim Bartosik <[email protected]> wrote: > 09.09.2010 16:07, Bernhard Leicher wrote: > > > On Sep 9, 4:00 pm, Joachim Bartosik <[email protected]> wrote: > >> Maybe I missed something but I don't understand what's wrong with > >> putting line like > > >> attribute :boolean > > >> in fields? > > > That's what I did! Setting attribute to '' (Model#attribute='') then > > results in > > Model#attribute => nil > > Model#read_attribute(:attribute) => false > > When I save that record, false is saved to db, where I wanted nil to > > be saved. > > So you need Boolean to store three values for you - {true, false, nil}, > not just two of them - {true, false-or-nil}? Hmmm I never needed that so > I don't know ho to do this (other then writing your own type which is > probably BadIdea (tm) ). > > Regards, > Joachim > > signature.asc > < 1 000AfficherTélécharger -- You received this message because you are subscribed to the Google Groups "Hobo Users" 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/hobousers?hl=en.
