Skip to content

Commit

Permalink
Update cached car pages when creating a new season
Browse files Browse the repository at this point in the history
  • Loading branch information
BGMP committed May 9, 2024
1 parent 0b792c9 commit cacfb8d
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions app/controllers/seasons_controller.rb
Expand Up @@ -49,6 +49,14 @@ def create
format.json { render :show, :status => :created, :location => @season, :layout => false }

Rails.cache.delete('current_season')

Rails.cache.delete('rookie_cars')
Rails.cache.delete('amateur_cars')
Rails.cache.delete('advanced_cars')
Rails.cache.delete('semipro_cars')
Rails.cache.delete('pro_cars')
Rails.cache.delete('superpro_cars')
Rails.cache.delete('clockwork_cars')
else
format.html { render :new, :status => :unprocessable_entity }
format.json { render :json => @season.errors, :status => :unprocessable_entity, :layout => false }
Expand Down

0 comments on commit cacfb8d

Please sign in to comment.