Commenting out default generated fixtures

16 views
Skip to first unread message

Prathamesh Sonpatki

unread,
Nov 16, 2014, 4:28:22 PM11/16/14
to rubyonra...@googlegroups.com
Hello all,

A newly created fixture file by Rails generators contains some fixtures by default with keys 'one' and 'two'. 
If I add any null constraint on some column in that table and try to run tests then it fails. Because Rails tries
to insert records with null values on columns having not-null constraint.

What do you think about adding the fixtures through generators but commenting them. So when I actually want 
to use those fixtures, I will go into fixtures file and uncomment the existing ones or add new ones. 
Right now it becomes a little painful to see build failing just because of those fixtures.

Thanks.

--
./prathamesh

Norm Scherer

unread,
Nov 17, 2014, 9:09:36 PM11/17/14
to rubyonra...@googlegroups.com
Its your code. Do with it whatever make sense. The generators are only
there to make life easier by quickly giving you the outline of a
system. If what they create does not really fit what you are doing,
change it to match your needs.

Norm
Reply all
Reply to author
Forward
0 new messages