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

Commit

Permalink
Defualt to unlimited players in games.
Browse files Browse the repository at this point in the history
Fixed #66.
  • Loading branch information
Christopher Peplin committed Oct 20, 2010
1 parent b6b09f1 commit dd59157
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 4 deletions.
3 changes: 1 addition & 2 deletions app/models/game.rb
Expand Up @@ -19,8 +19,7 @@ class Game < ActiveRecord::Base
validates :regulation_type, :presence => true

validates :speed, :presence => true, :percentage => true
validates :max_players, :presence => true,
:numericality => {:greater_than_or_equal_to => 1}
validates :max_players, :numericality => {:greater_than_or_equal_to => 1}

validates :max_line_capacity, :presence => true, :numericality => {
:greater_than_or_equal_to => 25, :less_than_or_equal_to => 2000}
Expand Down
2 changes: 1 addition & 1 deletion db/migrate/20100903210241_create_games.rb
Expand Up @@ -3,7 +3,7 @@ def self.up
create_table :games do |t|
t.integer :speed, :null => false, :default => 0
t.datetime :updated_at, :null => false, :default => Time.now
t.integer :max_players, :null => false, :default => 1
t.integer :max_players
t.datetime :started
t.datetime :ended

Expand Down
2 changes: 1 addition & 1 deletion spec/models/game_spec.rb
Expand Up @@ -11,7 +11,7 @@

it { should validate_presence_of :speed}

it { should validate_presence_of :max_players}
it { should_not validate_presence_of :max_players}
it { should allow_value(3).for(:max_players) }
it { should_not allow_value(0).for(:max_players) }

Expand Down

0 comments on commit dd59157

Please sign in to comment.