Add GamePolicy and integrate with the Game model
[cs356-p2-videostore.git] / app / models / rentable.rb
index faef2c5..e52af25 100644 (file)
@@ -1,6 +1,11 @@
 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 :genre
+  # don't validate newrelease, false is ok
+
+  def checkedout?
+    return Coitem.find_by_rentable_id(self.id) ? true : false
+  end
 end