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,12 +13,12 @@ class StoaPlugin::UspUser < ActiveRecord::Base | ||
13 | end | 13 | end |
14 | 14 | ||
15 | def self.matches?(usp_id, field, value) | 15 | def self.matches?(usp_id, field, value) |
16 | - usp_id.gsub!(/[.-]/,'') | ||
17 | - value.gsub!(/[.-]/,'') | 16 | + usp_id.to_s.gsub!(/[.-]/,'') |
18 | user = StoaPlugin::UspUser.find_by_codpes(usp_id.to_i) | 17 | user = StoaPlugin::UspUser.find_by_codpes(usp_id.to_i) |
19 | return false if user.nil? || !user.respond_to?(field) || value.blank? | 18 | return false if user.nil? || !user.respond_to?(field) || value.blank? |
20 | case field.to_sym | 19 | case field.to_sym |
21 | when :cpf | 20 | when :cpf |
21 | + value.to_s.gsub!(/[.-]/,'') | ||
22 | user.cpf == Digest::MD5.hexdigest(SALT+value.to_i.to_s) | 22 | user.cpf == Digest::MD5.hexdigest(SALT+value.to_i.to_s) |
23 | when :birth_date | 23 | when :birth_date |
24 | user.birth_date.to_s == value | 24 | user.birth_date.to_s == value |