Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Should: Fetch albums based on artist #8

Closed
oobbles opened this issue Jun 23, 2015 · 1 comment
Closed

Should: Fetch albums based on artist #8

oobbles opened this issue Jun 23, 2015 · 1 comment
Assignees

Comments

@oobbles
Copy link
Owner

oobbles commented Jun 23, 2015

Fetch all albums with a given artist

@oobbles oobbles self-assigned this Jun 23, 2015
@oobbles oobbles added this to the Remaining Models and Views milestone Jun 23, 2015
@oobbles
Copy link
Owner Author

oobbles commented Jun 25, 2015

  def find_albums
    album_ids =[]
    results = CONNECTION.execute("SELECT * FROM albums_artists WHERE artist_id = #{@id};")
      results.each do |hash|
        album_ids << hash["album_id"]
      end
      Album.find_many(album_ids)
  end
end

@oobbles oobbles closed this as completed Jun 25, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant