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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T14:25:23+00:00 2026-06-11T14:25:23+00:00

My question has to do with data modeling. We have a Score-model which links

  • 0

My question has to do with data modeling.

We have a Score-model which links to both a Division model and a Element model. Between the Division and the Element model a habtm-relation exists. The score has to be evaluated against an attribute of the Element model (criterium attribute).

Now we want to introduce the concept of “Problems”. A problem is each score which does not pass the criterium. (additional info: Multiple scores will be recorded over time, different types of scores exist. Filters on score_types and date ranges are desired)

What is the best way to model the Problem concept?

  1. Just calculate the problems in the controller each time the view of the problems is requested
  2. Introduce a Problems-model (which does not really contain any new information from the Score and Element info
  3. Create a tableless Model like ActiveModel.
  4. None of the above, as it is a newbie question and you should do it like so and so … (fill in the blanks)

Any help would be much appreciated.

  • 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-11T14:25:24+00:00Added an answer on June 11, 2026 at 2:25 pm

    Without knowing what your codebase looks like and assuming the Problem model would only be storing the id of an associated Score, I’m going to suggest using a scope on your Score model. You can create the ARel query (or queries) to get the desired Scores without adding too much more code. Check the Rails Guide on Active Record Querying – Scopes section for more info.

    If you need the Problem model to do anything that the Score can’t do, I’d consider creating an actual model (persisted or not is another decision).

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

Sidebar

Related Questions

I have 2 core data entities: Question, and QuestionType. Every Question has exactly 1
This question has two parts. Part 1. Yesterday I had some code which would
HI, My question has to do with a very basic understanding of Writing data
I feel like this question has to have been asked but for the life
This question has been asked a number of times, I have noted, but none
I'm working on some data access logic with Spring, my question has to do
To follow up on my question on modeling relational data with nosql , I
This question has to have been asked before, but I think the search terms
This question has been asked more than once before, but I have not found
This question has been asked before, but none that I have reviewed give a

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.