Add the has_many_polymorphs plugin
[cs356-p2-videostore.git] / vendor / plugins / has_many_polymorphs / test / models / person.rb
diff --git a/vendor/plugins/has_many_polymorphs/test/models/person.rb b/vendor/plugins/has_many_polymorphs/test/models/person.rb
new file mode 100644 (file)
index 0000000..5d01982
--- /dev/null
@@ -0,0 +1,9 @@
+require 'parentship'
+class Person < ActiveRecord::Base                   
+  has_many_polymorphs :kids,
+                      :through => :parentships, 
+                      :from => [:people], 
+                      :as => :parent,
+                      :polymorphic_type_key => "child_type",
+                      :conditions => "people.age < 10"   
+end