class Account < ActiveRecord::Base
has_many :users, :as => :account, :dependent => :destroy
end
class Buyer < Account
set_table_name :buyers
end
class Seller < Account
set_table_name :sellers
end
class User < ActiveRecord::Base
belongs_to :account, :polymorphic => true
end
Tables (minimal fields for testing)
create_table :users do |t|
t.references :account, :polymorphic => true
t.string :name
end
create_table :buyers do |t|
t.string :company
end
create_table :sellers do |t|
t.string :organization
end