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 8168617
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 6, 20262026-06-06T20:35:10+00:00 2026-06-06T20:35:10+00:00

I have Lineup and Piece models joined by piece_lineup model (has many through). I

  • 0

I have Lineup and Piece models joined by piece_lineup model (has many through). I added a ‘status’ column to the piece_lineup model but i can’t figure out how to reference that attribute and/or change it. When listing the pieces associated with a lineup, I also want to list the status of the piece as it relates to the lineup. How do I do that?

  • 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-06-06T20:35:14+00:00Added an answer on June 6, 2026 at 8:35 pm

    It’s very simple to get this column. Add to your model:

    has_many :pieces, through: :piece_lineup, select: "pieces.*, piece_lineup.status as status"
    

    If you have to change this value, you should create Lineup#status_for_piece=(piece, status) (as example) method. Find necessary row and update status.

    Inserting is not elegant way, but join table is not a good place for frequently updated data at all

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

Sidebar

Related Questions

I have piece and lineup joined by piece_lineup piece_lineup is a has many through
I have a DataGridView in which one column has data that the user needs
The task I have is to (somewhat efficiently) read line-by-line through a very large,
I have 2 divs, each has a background image and I want them to
Can someone kindly help me lineup all blue divs to the left side and
Right now I have these buttons that line up nicely, but they have some
I have a dynamic list that I need to lineup nicely into 2 columns
I have a question which I see from googling has been discussed at length..
I have a WPF 3.5 MVVVM application which has a TextBlock in a ScrollViewer.
I have this PHP web application. It has a link to an XML file

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.