Skip to content
This repository has been archived by the owner on Nov 26, 2020. It is now read-only.

Commit

Permalink
Warn user if demand isn't being met.
Browse files Browse the repository at this point in the history
Fixed #138.
  • Loading branch information
Christopher Peplin committed Nov 4, 2010
1 parent 4cfbd80 commit 24f0454
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions app/controllers/application_controller.rb
Expand Up @@ -7,6 +7,7 @@ class ApplicationController < ActionController::Base

before_filter :conditional_find_games
before_filter :conditional_find_game
before_filter :check_capacity

if ::Rails.env == 'test'
rescue_from ActiveRecord::RecordNotFound, :with => :render_not_found
Expand Down Expand Up @@ -86,6 +87,14 @@ def current_state
current_user.current_state if current_user
end

def check_capacity
if current_state
if not current_state.demand_met?
flash[:error] = "Demand isn't being met!"
end
end
end

def game_required
unless current_game
store_location
Expand Down

0 comments on commit 24f0454

Please sign in to comment.