From fa8d6f8baed84a834ab319037652053c456deb8e Mon Sep 17 00:00:00 2001 From: Espen Antonsen Date: Sat, 1 Aug 2009 18:53:12 +0200 Subject: [PATCH] create does not work with ruby 1.8? some weird difference on server --- lib/scan.rb | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/lib/scan.rb b/lib/scan.rb index 39bef52..e7f59b5 100644 --- a/lib/scan.rb +++ b/lib/scan.rb @@ -18,12 +18,14 @@ module ScanFiles end if album.nil? puts "New album : " + File.basename( relpath ) - album = Album.create( :path => relpath ) + album = Album.new( :path => relpath ) + album.save end photo = Photo.find_by_path( relfile ) if photo.nil? puts " New photo added " + relfile - photo = Photo.create( :album => album, :path => relfile ) + photo = Photo.new( :album => album, :path => relfile ) + photo.save else puts " Found photo " + relfile end