return
end
+ @maxoverduevideos = RentablePolicy.find_by_name("MaxOverdueVideos")
+ if @rentable.class == Video and @customer.overdue_videos >= @maxoverduevideos.value
+ flash[:error] = "#{@maxoverduevideos.description} LIMIT REACHED"
+ redirect_to :action => :rent_begin
+ return
+ end
+
+ @maxoverduegames = RentablePolicy.find_by_name("MaxOverdueGames")
+ if @rentable.class == Game and @customer.overdue_games >= @maxoverduegames.value
+ flash[:error] = "#{@maxoverduegames.description} LIMIT REACHED"
+ redirect_to :action => :rent_begin
+ return
+ end
+
# Check out the item
checkout = Coitem.new
checkout.customer = @customer