Fix all Rails/Validation rubocop issues and remove files from rubocop_todo list

This commit is contained in:
Bertocq
2017-06-21 20:49:44 +02:00
parent d759aca522
commit 8d84ed712a
7 changed files with 12 additions and 23 deletions

View File

@@ -7,10 +7,10 @@ class Verification::Residence
before_validation :call_census_api
validates_presence_of :document_number
validates_presence_of :document_type
validates_presence_of :date_of_birth
validates_presence_of :postal_code
validates :document_number, presence: true
validates :document_type, presence: true
validates :date_of_birth, presence: true
validates :postal_code, presence: true
validates :terms_of_service, acceptance: { allow_nil: false }
validates :postal_code, length: { is: 5 }

View File

@@ -3,7 +3,7 @@ class Verification::Sms
attr_accessor :user, :phone, :confirmation_code
validates_presence_of :phone
validates :phone, presence: true
validates :phone, format: { with: /\A[\d \+]+\z/ }
validate :uniqness_phone