2010/5/4 Sergio Cambra .:: entreCables S.L. ::. <[email protected]>: > 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
>> c = CliOut.new => #<CliOut id: nil, cli: nil, client_id: nil> >> c.cli = 888888888 => 888888888 >> c.client_id = "" => "" >> c.client_id => nil >> c.save => true And the row is stored with NULL value for client_id column (which is a numeric column allowing NULL with NULL as default value). But if I save it in active_scaffold then it is stored with client_id = 0. ¿? Perhaps I need to define some property for this column in the controller? -- Iñaki Baz Castillo <[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.
