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
/
eaters_foodstuff.rb
1
2
class EatersFoodstuff < ActiveRecord::Base
3
belongs_to :foodstuff, :class_name => "Petfood", :foreign_key => "foodstuff_id"
4
belongs_to :eater, :polymorphic => true
5
6
def before_save
7
self.some_attribute = 3
8
end
9
end
10