Commit 2ef130ea0bc2624b1cc25c4ccb0f56aa85b95b6f
Committed by
Arthur Esposte
1 parent
f8fa2101
Exists in
master
and in
5 other branches
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 < ActiveRecord::Base | @@ -5,4 +5,8 @@ class JuridicalNature < 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 |