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

  • Home
  • SEARCH
  • 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 501137
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 13, 20262026-05-13T06:09:32+00:00 2026-05-13T06:09:32+00:00

Situation: There is a Project Resource that has many Resources A each of them

  • 0

Situation:

  • There is a Project Resource that has many Resources A each of them having many Resources B
  • When a new Project is created it shall already start with clones of Resources A having clones of Resources B
  • There shall be a Reference Project whose Resources A and B (through A) are cloned from
  • Cloning is done because in this way new Projects can update their resources A and B without changing the Reference Project and vice versa

Question:

  • How to implement this in Rails?

Ideas:

  • Implement a singleton class ”ReferenceProject < Project” which inherits from Project
    • But STI would be overdone for just one Object?
  • Introduce a new column “is_reference_project” to Project
    • But how to ensure that there is only one?

Thanks for any input!
duddle

  • 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-13T06:09:32+00:00Added an answer on May 13, 2026 at 6:09 am

    I am now doing it this way:

    • Adding a column to Project called “is_reference” (:boolean)
    • Validating on model level that there is only one at the same time according to:
      • Stackoverflow: only one instance of a model in rails
    • Adding named_scopes for the Project model
    • Adding a ReferenceProjects Controller operating on named_scope
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I've created a plist (File->New File->Resource plist) file that has a dictionary that stores
I'm in a situation where I've got a project that has a large number
Consider the following situation. I have 3 tables in a resource planning project(created using
I have a following situation in my project. There are some tag values which
Situation: There are several entities in a simulated environment, which has an artificial notion
Situation is like this: There are independent 5 services. Each service consists of a
I have created a new VS2008 ASP.Net Web service project, with the default name
The situation is this: I have a Setup project created for my .NET application,
I have a situation where I'd like to execute javadoc in a project that
First off, I'm aware that there are many questions related to this, but none

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.