Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

Ruby

I've an item model. I want to add ratings. How should I proceed?

I'm working on a rating website.

I've a user & items that I want to rate.

item has a name and url. ratings should have name & value. I've about 20 criteria that I want to rate on.

Should i just create the rating model with 20 attributes or is there another way?

Update 1: Going for this solution: https://www.reddit.com/r/rails/comments/7pkf2i/helpbest_way_to_create_model_with_lots_columns/

Is this the "preferred" option for speed for the visitor?

1 Answer

Christopher McAnally
Christopher McAnally
2,941 Points

The better way might be to create a Criteria model, and then create a join table to link items and criteria.