This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def files | |
# I think I will need to create an array of file names here of the files whose data I want to import | |
@files = [] | |
Dir.entries(path).select do |file| | |
if !File.directory?(file) && file.end_with?(".mp3") | |
# why does if need to check file.directory? | |
@files << file | |
end | |
end | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def artist_name=(name) | |
self.artist = Artist.find_or_create_by_name(name) | |
artist.add_song(self) #why not self.add_song(self)?? | |
end |
NewerOlder