create does not work with ruby 1.8? some weird difference on server
This commit is contained in:
parent
4884cf2451
commit
fa8d6f8bae
1 changed files with 4 additions and 2 deletions
|
@ -18,12 +18,14 @@ module ScanFiles
|
||||||
end
|
end
|
||||||
if album.nil?
|
if album.nil?
|
||||||
puts "New album : " + File.basename( relpath )
|
puts "New album : " + File.basename( relpath )
|
||||||
album = Album.create( :path => relpath )
|
album = Album.new( :path => relpath )
|
||||||
|
album.save
|
||||||
end
|
end
|
||||||
photo = Photo.find_by_path( relfile )
|
photo = Photo.find_by_path( relfile )
|
||||||
if photo.nil?
|
if photo.nil?
|
||||||
puts " New photo added " + relfile
|
puts " New photo added " + relfile
|
||||||
photo = Photo.create( :album => album, :path => relfile )
|
photo = Photo.new( :album => album, :path => relfile )
|
||||||
|
photo.save
|
||||||
else
|
else
|
||||||
puts " Found photo " + relfile
|
puts " Found photo " + relfile
|
||||||
end
|
end
|
||||||
|
|
Loading…
Add table
Reference in a new issue