Add media MVC
[cs356-p2-videostore.git] / app / models / video.rb
index abf0de3..411c978 100644 (file)
@@ -1,5 +1,6 @@
 class Video < Rentable
   has_many :video_genres
+  has_many :medias
 
   validates_presence_of :director
   validates_presence_of :video_genre
@@ -8,5 +9,6 @@ class Video < Rentable
   protected
   def validate
     errors.add(:video_genre, "does not exist in the database") if video_genre.nil?
+    errors.add(:media, "does not exist in the database") if media.nil?
   end
 end