Okay, here was my issue in detail.

Because I have 37 controllers/models, I needed to make it easier for me 
to manage them.  So I performed a lot of inheritance.  But, I forgot to 
add true associations.

Example Controller:

class UniversalTemplatesController < ApplicationController
  # contains all functions for all 37 controllers
end

class RushingOffensesController < UniversalTemplatesController
  # contains only an authenticate routine - nothing else
end

etc. etc. for the next 36 controllers

Example Model:

class InheritanceTemplate < ActiveRecord::Base
  self.abstract_class = true
  # contains all methods that other 37 models need
end

class RushingOffense < InheritanceTemplate
  # I forgot to put my associations in here
  # Instead I put them in the InheritanceTemplate model
  #   thinking they would inherit - untrue
  # Correction is below
  belongs_to  :team
end

etc. etc. for the other 36 models

class Team < ActiveRecord::Base
  # I did have has_many :inheritance_templates
  #  This was wrong
  #  Correction below
  has_many  :rushing_offenses
  has_many  :passing_offenses
  etc. etc.
end

Now I can do:

Team.all :join => [:rushing_offense, :passing_offense]
etc.

I can't believe I made this simple mistake.  I guess it happens when you 
have so many models/controllers and are working on a large project.

-- 
Posted via http://www.ruby-forum.com/.

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Ruby 
on Rails: Talk" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to