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 all albums based on given style #7

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

Should: Fetch all albums based on given style #7

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 style

@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_styles WHERE style_id = #{@id};")
      results.each do |hash|
        album_ids << hash["album_id"]
      end
      Album.find_many(album_ids)
  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