you could probably optimize this by writing the query like this: `song = artist.songs.find_by(title: params[:song_name]`.