projects
/
cs356-p2-videostore.git
/ blob
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
history
|
raw
|
HEAD
Many visual tweaks, suggested by Lan
[cs356-p2-videostore.git]
/
app
/
models
/
rentable_purchase.rb
1
class RentablePurchase < Purchase
2
belongs_to :rentable
3
belongs_to :customer
4
5
validates_presence_of :rentable_id
6
validates_numericality_of :rentable_id
7
8
protected
9
def validate
10
errors.add(:rentable_id, "is not in the database") if rentable.nil?
11
end
12
end