Commit 22dbf2f4e36d2bb5f592f044659cf97eb8b31cad
1 parent
193a85c4
Exists in
remove_secondary_email_from_user
Fixes public institution validations
- Governmental Power, Sphere, and Juridical Nature validations when the country is not Brazil Signed-off-by: Gabriel Silva <gabriel93.silva@gmail.com>
Showing
1 changed file
with
1 additions
and
1 deletions
Show diff stats
src/noosfero-spb/gov_user/lib/public_institution.rb
1 | class PublicInstitution < Institution | 1 | class PublicInstitution < Institution |
2 | validates :governmental_power, :governmental_sphere, :juridical_nature, | 2 | validates :governmental_power, :governmental_sphere, :juridical_nature, |
3 | - :presence=>true | 3 | + :presence=>true, :unless=>lambda{self.community.country != "BR"} |
4 | 4 | ||
5 | validates :cnpj, | 5 | validates :cnpj, |
6 | :format => {with: CNPJ_FORMAT}, | 6 | :format => {with: CNPJ_FORMAT}, |