Class: Community

Inherits:
ActiveRecord::Base
  • Object
show all
Defined in:
lib/dspace/active_record/community.rb

Class Method Summary collapse

Class Method Details

.find_all_sub_communitiesObject



30
31
32
# File 'lib/dspace/active_record/community.rb', line 30

def self.find_all_sub_communities
  Community.find_by_sql("SELECT community.* FROM community WHERE community_id IN (SELECT child_comm_id FROM community2community)")
end

.find_all_top_levelObject



26
27
28
# File 'lib/dspace/active_record/community.rb', line 26

def self.find_all_top_level
  Community.find_by_sql("SELECT community.* FROM community WHERE community_id NOT IN (SELECT child_comm_id FROM community2community)")
end