projects
/
cs356-p2-videostore.git
/ blob
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
history
|
raw
|
HEAD
Add the has_many_polymorphs plugin
[cs356-p2-videostore.git]
/
vendor
/
plugins
/
has_many_polymorphs
/
test
/
models
/
person.rb
1
require 'parentship'
2
class Person < ActiveRecord::Base
3
has_many_polymorphs :kids,
4
:through => :parentships,
5
:from => [:people],
6
:as => :parent,
7
:polymorphic_type_key => "child_type",
8
:conditions => "people.age < 10"
9
end