Final import fix (i hope).

This commit is contained in:
magnolia-fan
2011-06-24 15:15:35 +04:00
parent 96c3d925df
commit 3c11bcd8d7
4 changed files with 43 additions and 7 deletions
+20
View File
@@ -0,0 +1,20 @@
namespace :db do
desc 'Cleans artist-album-track relations clean'
task :cleanup => :environment do
albums = Album.all
albums.each do |album|
if album.artist.nil?
album.delete
end
end
tracks = Track.all
tracks.each do |track|
if track.album.nil?
track.delete
end
end
end
end
+1 -1
View File
@@ -4,7 +4,7 @@ namespace :db do
desc 'Imports test data from MusicBrainz database'
task :import => :environment do
ati = ['Marilyn Manson']
ati = ['The Lonely Island']
ati.each do |name|
ImportController.importArtist(name)
#ap res = ArtistController.musicBrainzExactSearch(name)