X-Git-Url: https://irasnyder.com/gitweb/?a=blobdiff_plain;f=app%2Fmodels%2Fvideo_policy.rb;fp=app%2Fmodels%2Fvideo_policy.rb;h=5e827bd2ba8956960a6ba7cbb4eff47877ce6905;hb=01114330b962728805d3c43f2f1a1423f2bd66b3;hp=ec1e7041aefde23aa52a159b0956bed65244feda;hpb=09ddd1ef5546ec679c832c7cefb93f00125c96c6;p=cs356-p2-videostore.git diff --git a/app/models/video_policy.rb b/app/models/video_policy.rb index ec1e704..5e827bd 100644 --- a/app/models/video_policy.rb +++ b/app/models/video_policy.rb @@ -8,26 +8,6 @@ class VideoPolicy < ActiveRecord::Base validates_numericality_of :fee validates_numericality_of :period - # Find the base fee for today - def todays_fee - # Gets the current day of the week in 0-6 == Sun-Sat form - day_of_week = Time.now.to_date.wday - return VideoPolicy.find_by_day(day_of_week).fee - end - - # Find the base rental period for today - def todays_period - # Gets the current day of the week in 0-6 == Sun-Sat form - day_of_week = Time.now.to_date.wday - return VideoPolicy.find_by_day(day_of_week).period - end - - # Find the fee for overdue videos (per day) - def overdue_fee - overdue_day = 7 - return VideoPolicy.find_by_day(overdue_day).fee - end - protected def validate errors.add(:fee, "must be greater than $0.01") if fee < 0.01