diff --git a/app/models/game.rb b/app/models/game.rb index b91fd85..d496791 100644 --- a/app/models/game.rb +++ b/app/models/game.rb @@ -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} diff --git a/db/migrate/20100903210241_create_games.rb b/db/migrate/20100903210241_create_games.rb index 184da80..0712fe7 100644 --- a/db/migrate/20100903210241_create_games.rb +++ b/db/migrate/20100903210241_create_games.rb @@ -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 diff --git a/spec/models/game_spec.rb b/spec/models/game_spec.rb index 0c669f0..60f3dc9 100644 --- a/spec/models/game_spec.rb +++ b/spec/models/game_spec.rb @@ -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) }