governmental_power.rb 287 Bytes Edit Raw Blame History 1 2 3 4 5 6 7 8 9 10 11 12 13 class GovernmentalPower < ActiveRecord::Base attr_accessible :name validates :name, :presence=>true, :uniqueness=>true has_many :institutions def public_institutions Institution.where( :type=>"PublicInstitution", :governmental_power_id=>self.id ) end end