Commit 22dbf2f4e36d2bb5f592f044659cf97eb8b31cad

Authored by Gabriel Silva
1 parent 193a85c4

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>
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},