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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 20, 20262026-05-20T06:40:23+00:00 2026-05-20T06:40:23+00:00

Need help figuring this out. Have a product model: class Product :name :short_description :price

  • 0

Need help figuring this out.

Have a product model:

class Product 
   :name 
    :short_description 
    :price 
    :cost 
    :visible 
    :new_service 
    :deleted 
    :category_id 
 end

Have a line item model. Pretty much copies product model except:

class LineItem
    :order_id 
    :customer_id
    :company_id
end

Now need to figure out how to add a Product Group which will consists of multiple products and carry all of the same attr as the product model. Normally I would do a joins table with :ids, but need the ability to edit the price and cost of each product in the group.

Stumped on this one.

  • 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-20T06:40:24+00:00Added an answer on May 20, 2026 at 6:40 am
    class ProductGroup
      has_many :special_products
    end
    
    class SpecialProducts
      belongs_to :product
      belongs_to :product_group
    
      #attributes for overridden prices
      #delegate other attributes to product
      delegate :name, :to => :product, :allow_nil => true
    end
    
    class Product
      has_many :special_products
      has_many :product_groups, :through => :special_products
    end
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Need help figuring this out. I have two tables user ---- name skills (comma
Need some php help in figuring out how use this array I created, but
http://jsfiddle.net/nicktheandroid/ZSvHK/ I need help figuring out how to get this right, problems listed below.
i need help with disk_total_space function.. i have this on my code <?php $sql=select
I need help figuring out how to change out the view in my application.
I need help figuring out these php print (echo) statements and where to place
I need some help figuring out why the following scenario does not work. I'm
I need some help figuring out the best way to proceed with creating a
I need some help figuring out how to make some changes to some .jsp
I need some help figuring out a solution to a z-index problem with ie7.

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.