projects
/
cs356-p2-videostore.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
| inline |
side by side
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
+++ b/
vendor/plugins/has_many_polymorphs/test/models/person.rb
@@ -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