Forum: Ruby on Rails Subclassing only a specific portion?

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
Nic W. (Guest)
on 2006-01-08 03:26
(Received via mailing list)
Hi,
 I'm sure there is an easy way to do this, but I just can't see it:

 I have a large amount of rooms, that are for different purposes, and
for only one 'purpose' do I want to create a specific subclass. Ex:
banquet,wedding,admin. I want to have additional information about
admin rooms.

 Trying to use the 'type' field just gives an error because I don't
have subclasses defined for them.

OR, if I just seperate this type of rooms into a different table, then
when I go to do a listing of rooms, it wouldn't show up. Also,
thinking OO, a type of room is just a subset of room.

Am I thinking too hard for this?
--
- Nic
Nic W. (Guest)
on 2006-01-10 19:48
(Received via mailing list)
Well, just to update those who might have the same problem down the
road, I am just adding an extra column for that specific type,
'admin_id', and just creating a default controller that brings up all
rooms where admin_id is not null.

Not the greatest solution, and doesn't fit with AR too well.

- Nic.

On 1/7/06, Nic W. <removed_email_address@domain.invalid> wrote:
>
> OR, if I just seperate this type of rooms into a different table, then
> when I go to do a listing of rooms, it wouldn't show up. Also,
> thinking OO, a type of room is just a subset of room.
>
> Am I thinking too hard for this?
> --
> - Nic
>


--
- Nic
This topic is locked and can not be replied to.