Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 368803
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 12, 20262026-05-12T13:51:32+00:00 2026-05-12T13:51:32+00:00

Sometimes more than one artist will be on a song. For example, Jay-z’s new

  • 0

Sometimes more than one artist will be on a song. For example, Jay-z’s new song “A Star is Born” features the artist Cole, and thus would be listed as “Jay-z (featuring Cole) – A Star is Born” in a catalog. My question is how to model this in my database.

Right now it’s pretty simple: every song belongs_to :artist and every artist has_many :songs. I want to change this so that songs have many artists, with one artist specified as “primary” — i.e., if A, B, and C are all associated with a given song and A is primary, the artist of that song will be displayed as “A (featuring B and C)”.

Here’s what I’m thinking:

Song:

has_many :artists, :through => :performances

Artist:

has_many :songs, :through => :performances

where the performance model would have a single field for primary?, designating whether a given performance was the “primary” performance on the song, meaning that the artist associated with that performance is the primary artist on the song.

Does this approach make sense?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-12T13:51:32+00:00Added an answer on May 12, 2026 at 1:51 pm

    Yes. You nailed it.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I sometimes run more than one eclipse with a new version of a project
It happens sometimes that one feature seems to belong to more than one place.
I have read that a variable should never do more than one thing. Overloading
The users of my web application may have more than one browser window open
On more than one occasion I have found myself desiring a variable visibility that
I want to pop more than one controller that means If I have totally
We work usually on more than one version of the application, where each version
Surprisingly one can show more than one dialog at a time by putting the
I'm trying to send more than one image file from a client to the
IntelliJ IDEA by default has the functionality to debug/run more than one instance of

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.