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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T04:12:24+00:00 2026-06-12T04:12:24+00:00

I have a model to keep track of points a student earns. Sometimes they

  • 0

I have a model to keep track of points a student earns. Sometimes they earn 1 point and for some tasks they earn multiple points. The table would look something like this:

points
--------------
student_id:integer
task_id:integer
points:integer
earned_at:date

What should I call this model? Point or Points? Typically my models are singular and Rails intelligently pluralizes it in the appropriate places. But in this case each record represents a number of points. When I call student.points I want it to return all the points they’ve ever earned. When I call student.points.first I want it to return the first group of points they earned.

Using Rails 3.2.8

  • 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-12T04:12:25+00:00Added an answer on June 12, 2026 at 4:12 am

    I’d keep the model singular; think each Point item as a “point record” or “point group” which contains multiple points. Also, I’d change the ‘points’ attribute to ‘amount’ or something, as Point.amount seems cleaner than Point.points.

    Check out: https://stackoverflow.com/a/3399753/1700540 and I’m sure you can find other resources with similar opinions.

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

Sidebar

Related Questions

I have a model which contains a ManyToMany to User to keep track of
I have various models of which I would like to keep track and collect
I have model Article it has field title with some text that may contain
Hi, I have a Strongly typed view in ASP.NET MVC. To keep track on
I have model with a location, which itself has a latitude and longitude. What
I have model Foo which has field bar. The bar field should be unique,
I have model public class UploadOptionModel { public UploadOptionModel() { OutputFormat = outputFormatList.Select(i =>
I have model: [XmlRoot(ElementName = event, IsNullable=true)] public class Event { public int id
I have model: # encoding: utf-8 class Tag include Mongoid::Document field :name, type: String
I have model like this: scope :search_posts, lambda { |query| mega_posts.where( title LIKE ?

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.