FIX: Validate poll arguments. (#6740)

* FIX: Validate number poll.
* FEATURE: Poll's min can be 0.
* FIX: Fix URL to user profile.
This commit is contained in:
Bianca Nenciu
2018-12-31 11:48:30 +02:00
committed by Régis Hanol
parent 0fca3205b5
commit e49bcebb35
6 changed files with 180 additions and 25 deletions

View File

@@ -29,7 +29,7 @@ class Poll < ActiveRecord::Base
everyone: 1,
}
validates :min, numericality: { allow_nil: true, only_integer: true, greater_than: 0 }
validates :min, numericality: { allow_nil: true, only_integer: true, greater_than_or_equal_to: 0 }
validates :max, numericality: { allow_nil: true, only_integer: true, greater_than: 0 }
validates :step, numericality: { allow_nil: true, only_integer: true, greater_than: 0 }