Commit 2ef130ea0bc2624b1cc25c4ccb0f56aa85b95b6f

Authored by Gabriela Navarro
Committed by Arthur Esposte
1 parent f8fa2101

Add method to get public institutions from juridical natures

Signed-off-by: Gabriela Navarro <navarro1703@gmail.com>
Showing 1 changed file with 4 additions and 0 deletions   Show diff stats
lib/juridical_nature.rb
... ... @@ -5,4 +5,8 @@ class JuridicalNature &lt; ActiveRecord::Base
5 5  
6 6 validates_presence_of :name
7 7 validates_uniqueness_of :name
  8 +
  9 + def public_institutions
  10 + Institution.where(:type=>"PublicInstitution", :governmental_power_id=>self.id)
  11 + end
8 12 end
... ...