私はモデル(テストと呼ばれる)を持っています:
property :id, Serial
property :title, String, :length => 255, :required => true
property :description, String, :length => 255, :required => true
property :brand, String, :length => 255, :required => true
property :link, String, :length => 255, :required => true
property :image_link, String, :length => 255, :required => true
property :price, String, :length => 255, :required => true
property :condition, String, :length => 255, :required => true
property :product_type, String, :length => 255, :required => true
FasterCSVを使用して、タブ区切りファイルからデータをインポートしています。
FasterCSV.foreach( "test.txt"、{:headers => true、:quote_char =>'"'、:col_sep =>'/ t'})do | row_data |
row_data = Test.first_or_new(
'title' => :title,
'description' => :supplier,
'brand' => :brand,
'link' => :link,
'image_link' => :image_link,
'price' => :price,
'condition' => :condition,
'product_type' => :product_type
)
row_data.save
終わり
インポーターを実行してもエラーは表示されません。SQLiteテーブルに何も挿入されていないようです。
明らかな何かが欠けていますか?(テーブルはターゲットデータベース内に存在し、フィールド名は私のファイルのヘッダーと同じです。