On Lunes, 3 de Mayo de 2010 20:16:44 Iñaki Baz Castillo escribió: > Hi, I've a table with a numeric column and it allows NULL. But if I > leave the field empty when creating a new entry then it's stored as 0 > rather than NULL.
I can't reproduce it. Does it have a default value? Can you try to set '' to that column in script/console?: record = Model.new record.column = '' record.column > The workaround is inspect the value in before_create_save(): > > if model.field == 0 > model.field = nil > end > > Is there any way to automatically store NULL value? why does > active_scaffold convert it to 0 (note that the column does allow NULL > value). > > Thanks. > > -- > Iñaki Baz Castillo > <[email protected]> -- Sergio Cambra .:: entreCables S.L. ::. Mariana Pineda 23, 50.018 Zaragoza T) 902 021 404 F) 976 52 98 07 E) [email protected] -- You received this message because you are subscribed to the Google Groups "ActiveScaffold : Ruby on Rails plugin" 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/activescaffold?hl=en.
