Doug Jolley wrote:
>> In Rails, a model normally maps to a table.
> 
> Yes; but, it appears that in this case it would be really nice if I
> could have a single model and then somehow simply switch between
> associated tables.  (I'm not sure that I'm going to be able to do it.)

Why not just subclass?

class Person < ActiveRecord::Base
  self.abstract_class = true # this will prevent Rails from expecting a 
"people" table

  # common features go here
end

class Client < Person
  ...
end

class Prospect < Person
  ...
end

That should do the trick!

Best,
--
Marnen Laibow-Koser
http://www.marnen.org
[email protected]
-- 
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