On Feb 2, 2010, at 1:42 PM, John Mcleod wrote:

> I need to add default values (0) to 2 columns that are not in the csv.
> 
> For example,
> 
>        Column 1,  Column 2,  New Column 1,  New Column 2
>        ---------  ---------  -------------  ------------
> Row 1   csv value  csv value   0              0
> 
> 
> When I go to create a row, I want to check for these column headers and 
> write to the table with a zero.

How about changing this code:

  Irb.create!(row.to_hash)

to:

  Irb.create!( { "New Column 1" => 0,
                 "New Column 2" => 0 }.merge(row.to_hash) )

Does that do what you wanted?

James Edward Gray II