protected

This commit is contained in:
Espen Antonsen 2009-08-01 20:12:34 +02:00
parent e95b6e6978
commit 2ddea72d7f
2 changed files with 6 additions and 3 deletions

View file

@ -18,7 +18,8 @@ module ScanFiles
end
if album.nil?
puts "New album : " + File.basename( relpath )
album = Album.new( :path => relpath )
album = Album.new()
album.path = relpath
unless album.save
raise "unable to save album"
end
@ -26,7 +27,9 @@ module ScanFiles
photo = Photo.find_by_path( relfile )
if photo.nil?
puts " New photo added " + relfile
photo = Photo.new( :album => album, :path => relfile )
photo = Photo.new( )
photo.album = album
photo.path = relfile
unless photo.save
raise "unable to save photo"
end