I''m not sure I understand why the number of levels (3, 4, or 104) is an
issue. So, perhaps I''m not understanding your question. But why not:
class Framework < ActiveRecord::Base
has_many :strands, :dependent => :destroy
end
class Strand < ActiveRecord::Base
belongs_to :framework
has_many :levels, :dependent => :destroy
end
class Level < ActiveRecord::Base
belongs_to :strand
has_many :benchmarks, :dependent => :destroy
end
class Benchmark < ActiveRecord::Base
belongs_to :level
end
--wpd
On Wed, Dec 10, 2008 at 11:37 PM, gil
<gilmangunn-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:
>
> I can''t quite seem to get the data model down for a fairly simple
set
> of data.
>
> The data is:
>
> Framework --> Strand --> Level --> Benchmark
>
> It would be simple enough if there were only three levels but since
> there are four I can''t use straight has_many xyz :through clause.
>
> The end goal is to have users be able to select a framework, then a
> strand, then a level, then a benchmark.
>
> Any help would be appreciated.
>
> >
>
--~--~---------~--~----~------------~-------~--~----~
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
rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
To unsubscribe from this group, send email to
rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
For more options, visit this group at
http://groups.google.com/group/rubyonrails-talk?hl=en
-~----------~----~----~----~------~----~------~--~---