projects
/
cs356-p2-videostore.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Many visual tweaks, suggested by Lan
[cs356-p2-videostore.git]
/
app
/
models
/
rentable.rb
diff --git
a/app/models/rentable.rb
b/app/models/rentable.rb
index
faef2c5
..
e52af25
100644
(file)
--- a/
app/models/rentable.rb
+++ b/
app/models/rentable.rb
@@
-1,6
+1,11
@@
class Rentable < ActiveRecord::Base
class Rentable < ActiveRecord::Base
- belongs_to :coitem # FIXME: I hunch this is wrong
+ has_many :coitems
+ has_many :rentable_purchases
validates_presence_of :title
validates_presence_of :title
- validates_presence_of :genre
+ # don't validate newrelease, false is ok
+
+ def checkedout?
+ return Coitem.find_by_rentable_id(self.id) ? true : false
+ end
end
end