class SakaiInfo::SiteProperty
Public Class Methods
find_by_site_id(site_id)
click to toggle source
# File lib/sakai-info/site.rb, line 513 def self.find_by_site_id(site_id) properties = {} DB.connect[:sakai_site_property]. where(:site_id => site_id).all.each do |row| properties[row[:name]] = row[:value].read end return properties end
find_site_ids_by_property(name, value)
click to toggle source
# File lib/sakai-info/site.rb, line 522 def self.find_site_ids_by_property(name, value) DB.connect[:sakai_site_property]. where(:name => name, Sequel.function(:to_char, :value) => value). all.collect{|r| r[:site_id]} end
get(site_id, property_name)
click to toggle source
# File lib/sakai-info/site.rb, line 503 def self.get(site_id, property_name) row = DB.connect[:sakai_site_property]. where(:site_id => site_id, :name => property_name).first if row.nil? nil else row[:value].read end end