Commit f35e081ba81986475def07347ccd60ac28fda4cd
1 parent
4a0ec8b5
Exists in
master
and in
29 other branches
Fixed stoa tests
Showing
1 changed file
with
2 additions
and
2 deletions
Show diff stats
plugins/stoa/lib/stoa_plugin/usp_user.rb
... | ... | @@ -13,12 +13,12 @@ class StoaPlugin::UspUser < ActiveRecord::Base |
13 | 13 | end |
14 | 14 | |
15 | 15 | def self.matches?(usp_id, field, value) |
16 | - usp_id.gsub!(/[.-]/,'') | |
17 | - value.gsub!(/[.-]/,'') | |
16 | + usp_id.to_s.gsub!(/[.-]/,'') | |
18 | 17 | user = StoaPlugin::UspUser.find_by_codpes(usp_id.to_i) |
19 | 18 | return false if user.nil? || !user.respond_to?(field) || value.blank? |
20 | 19 | case field.to_sym |
21 | 20 | when :cpf |
21 | + value.to_s.gsub!(/[.-]/,'') | |
22 | 22 | user.cpf == Digest::MD5.hexdigest(SALT+value.to_i.to_s) |
23 | 23 | when :birth_date |
24 | 24 | user.birth_date.to_s == value | ... | ... |