2 require 'has_many_polymorphs'
7 class GuestsKennel < Base
9 belongs_to :guest, :polymorphic => true
22 has_many_polymorphs :guests,
23 :from => [:dogs, :cats, :birds],
24 :through => :guests_kennels,
25 :namespace => :"hmph/models/"
28 class InitialSchema < V 1.0
30 create_table :hmph_kennels do |t|
31 t.column :created_at, :datetime
32 t.column :modified_at, :datetime
33 t.column :name, :string, :default => 'Anonymous Kennel'
36 create_table :hmph_guests_kennels do |t|
37 t.column :guest_id, :integer
38 t.column :guest_type, :string
39 t.column :kennel_id, :integer
42 create_table :hmph_dogs do |t|
43 t.column :name, :string, :default => 'Fido'
46 create_table :hmph_cats do |t|
47 t.column :name, :string, :default => 'Morris'
50 create_table :hmph_birds do |t|
51 t.column :name, :string, :default => 'Polly'
56 drop_table :hmph_kennels
57 drop_table :hmph_guests_kennels
60 drop_table :hmph_birds
65 module Hmph::Controllers