From 0afb53fd203c2763d6b1dbd33f64244edeca1f09 Mon Sep 17 00:00:00 2001 From: Espen Antonsen Date: Sat, 1 Aug 2009 19:08:56 +0200 Subject: [PATCH] seems to be bug in ruby dir function --- lib/scan.rb | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/lib/scan.rb b/lib/scan.rb index e7f59b5..39bef52 100644 --- a/lib/scan.rb +++ b/lib/scan.rb @@ -18,14 +18,12 @@ module ScanFiles end if album.nil? puts "New album : " + File.basename( relpath ) - album = Album.new( :path => relpath ) - album.save + album = Album.create( :path => relpath ) end photo = Photo.find_by_path( relfile ) if photo.nil? puts " New photo added " + relfile - photo = Photo.new( :album => album, :path => relfile ) - photo.save + photo = Photo.create( :album => album, :path => relfile ) else puts " Found photo " + relfile end