Commit 80559e42f7397c21d40e29241ee07fb17e0da009

Authored by Gabriela Navarro
Committed by Gust
1 parent 4061b1f2

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,4 +5,8 @@ class JuridicalNature &lt; ActiveRecord::Base
5 5
6 validates_presence_of :name 6 validates_presence_of :name
7 validates_uniqueness_of :name 7 validates_uniqueness_of :name
  8 +
  9 + def public_institutions
  10 + Institution.where(:type=>"PublicInstitution", :governmental_power_id=>self.id)
  11 + end
8 end 12 end