Class: SakaiInfo::SiteProperty
- Inherits:
-
Object
- Object
- SakaiInfo::SiteProperty
- Defined in:
- lib/sakai-info/site.rb
Class Method Summary collapse
- .find_by_site_id(site_id) ⇒ Object
- .find_site_ids_by_property(name, value) ⇒ Object
- .get(site_id, property_name) ⇒ Object
Class Method Details
.find_by_site_id(site_id) ⇒ Object
403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 |
# File 'lib/sakai-info/site.rb', line 403 def self.find_by_site_id(site_id) properties = {} # HACK: reading blobs via OCI8 is really slow, make the db server do it! # This is multiple orders of magnitude faster. # But, this will break if the property value is > 4000chars and may not work # on mysql, so here's the original version: # DB.connect[:sakai_site_property].where(:site_id => site_id).all.each do |row| # properties[row[:name]] = row[:value].read # end DB.connect[:sakai_site_property]. select(:name, :to_char.sql_function(:value).as(:value)). where(:site_id => site_id).all.each do |row| properties[row[:name]] = row[:value] end return properties end |