Displaying 2 results from an estimated 2 matches for "sclaus".
Did you mean:
claus
2006 Feb 01
0
Nil in CSV Fixtures
The Guide to Testing the Rails
http://manuals.rubyonrails.com/read/chapter/26#page65
says about CSV fixtures:
nulls can be achived by just placing a comma, for example,
(1,sclaus,,false,) minus the parenthesis of course.
I tried that, but after the fixtures had been created, I checked the
value of the field in the DB and instead of nil the value was zero,
eventhough the default value for the field is NULL.
Is the guide wrong?
--
Posted via http://www.ruby-forum.com/.
2006 Feb 22
0
Problem: Null values in a CSV format fixture show up a 0 in the test database
...rom people;
That gives me a CSV file with null values represented as \N
According to the fixtures documentation, to get a null value inserted
into your test database from a CSV, you should have nothing between
the commas.
"nulls can be achived by just placing a comma, for example,
(1,sclaus,,false,) minus the parenthesis of course."
http://manuals.rubyonrails.com/read/chapter/26
So I went through and replaced \N with nothing ... as a result rows
that previously looked like:
7,\N,"Steve"
now look like
7,,"Steve"
The rails unit test libraries load the...