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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 22, 20262026-05-22T17:48:15+00:00 2026-05-22T17:48:15+00:00

I have trouble finding a way to link to class A to E. Here

  • 0

I have trouble finding a way to link to class A to E. Here are the class implied :

A has many B
B belongs to A
B belongs to C
A has many C through B

C has many D
D belongs to C
D belongs to E class_name C
C has_many E through D

Ok I know it is confusing so I made a schema and I hope it is more comprehensible…

enter image description here

My question is how can I link the class A with the class E (that is in reality class C with a particula role). How can I use a.es (es => plural of E :s ) ?

I tried A has_many E through C (in my mind it was a good solution because A has_many C (through B) and C has_many E (through D)) but it raise an error :

ActiveRecord::HasManyThroughSourceAssociationMacroError: Invalid source reflection macro :has_many :through for has_many :es, :through => :cs. Use :source to specify the source reflection

I’m coding on rails V2.3.9

If you have any idea please tell me.
Thank you in advance.

  • 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-22T17:48:16+00:00Added an answer on May 22, 2026 at 5:48 pm

    Although there are some plugins that extend the :through relationship functionality, it’s not generally possible to use ActiveRecord to navigate through multiple layers at the same time. The limit is generally one :through, no more.

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

Sidebar

Related Questions

I have trouble finding way to correctly refactor this code so that there would
I have trouble with the following piece of code. When I go through with
This question seems easy but for some reason I have trouble finding the answer.
I'm having trouble finding a way to write a query that will return all
I have trouble comparing 2 double in Excel VBA suppose that I have the
I have trouble using Perl grep() with a string that may contain chars that
I have trouble defining a trigger for a MySQL database. I want to change
I have no trouble building 1.35.0, as well as 1.36.0 on the timesys arm-gcc
I'm migrating to Nhibernate 2.0 GA but have some trouble with setting cache expirations
I am developing a small windows app, but have some trouble deciding whether to

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.