Lots of stuff, I got too tired to keep perfect revision history
[cs356-p2-videostore.git] / app / models / video.rb
index 7739aeb..8ca3901 100644 (file)
@@ -15,7 +15,6 @@ class Video < Rentable
   end
 
   def calculated_price
-    # FIXME: generate this based on day of week, newrelease
     day_of_week = Time.now.to_date.wday
     base_fee = VideoPolicy.find_by_day(day_of_week).fee
 
@@ -26,7 +25,6 @@ class Video < Rentable
   end
 
   def due_date
-    # FIXME: generate this based on the day of week, newrelease
     # NOTE: a Date.wday will tell you the day of week (0-6, meaning Sunday-Saturday)
     day_of_week = Time.now.to_date.wday
     base_period = VideoPolicy.find_by_day(day_of_week).period
@@ -38,7 +36,7 @@ class Video < Rentable
 
   protected
   def validate
-    errors.add(:video_genre, "does not exist in the database") if video_genre.nil?
-    errors.add(:video_media, "does not exist in the database") if video_media.nil?
+    errors.add(:video_genre_id, "does not exist in the database") if genre.nil?
+    errors.add(:video_media_id, "does not exist in the database") if media.nil?
   end
 end