Sorry if this feel as an 'up', but I felt I needed to provide a more
thorough explanation about what I want to accomplish.

I'm developing a game set on Star Wars universe. On this game, I'll have
Squadron that can buy Units to compose Fleets, provide they can (check with
a habtm association between Squad and Unit).

But we now need an extra layer of complexity upon this. We have a new kind
of Unit called Facility, which will produce a kind of Unit. I am creating a
new class for Fleets composed of Facilities as well.

So, Squad can have Fleets and FacilityFleets (has_many for both), and HABTM
on Units and Facilities. What I've come up so far is:

I have a GenericUnit which Unit and Facility inherits from, and a
GenericFleet which Fleet and FacilityFleet inherits from. My problem is that
I don't know how to set up these relationships. I've stuck on the
GenericUnit/Unit/Facility problem. I've kinda solved this as showed here:
http://pastie.org/1640550. But this doesn't look like the right way to solve
this. I'm pretty sure there is a smarter way of doing this.

Thanks for your help!

On Sun, Mar 6, 2011 at 17:51, Lunks <[email protected]> wrote:

> Is there a better way to do this? It looks really ugly!
> http://pastie.org/1640550
>

-- 
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