return
end
+ # Check Rentable Policies
+ @maxvideos = RentablePolicy.find_by_name("MaxVideos")
+ if @rentable.class == Video and @customer.checked_out_videos >= @maxvideos.value
+ flash[:error] = "#{@maxvideos.description} LIMIT REACHED"
+ redirect_to :action => :rent_begin
+ return
+ end
+
+ @maxgames = RentablePolicy.find_by_name("MaxGames")
+ if @rentable.class == Game and @customer.checked_out_games >= @maxgames.value
+ flash[:error] = "#{@maxgames.description} LIMIT REACHED"
+ redirect_to :action => :rent_begin
+ return
+ end
+
# Check out the item
checkout = Coitem.new
checkout.customer = @customer