Commit 0659957cbd175641e619916d42024a1f24d72893

Authored by Pedro Bruel
Committed by Rafael Manzo
1 parent a706d3da

Added numericality validation for grade field.

signed-off-by: Pedro Scocco <pedroscocco@gmail.com>
Showing 2 changed files with 7 additions and 2 deletions   Show diff stats
.gitignore
... ... @@ -20,4 +20,9 @@ coverage
20 20 database.yml
21 21 database.yml~
22 22 kalibro.yml
23   -kalibro_cucumber_helpers.yml
24 23 \ No newline at end of file
  24 +kalibro_cucumber_helpers.yml
  25 +KalibroService.tar.gz
  26 +KalibroService/
  27 +analizo_1.16.0_all.deb
  28 +db_bootstrap.sql
  29 +install.sh
... ...
app/models/reading.rb
... ... @@ -4,7 +4,7 @@ class Reading &lt; KalibroGatekeeperClient::Entities::Reading
4 4 attr_accessor :label, :grade, :color
5 5  
6 6 validates :label, presence: true, kalibro_uniqueness: true
7   - validates :grade, presence: true #TODO: Validates numeracy
  7 + validates :grade, presence: true, numericality: true
8 8 validates :color, presence: true
9 9  
10 10 end
... ...