Class: SakaiInfo::GroupProperty

Inherits:
Object
  • Object
show all
Defined in:
lib/sakai-info/group.rb

Class Method Summary collapse

Class Method Details

.find_by_group_id(group_id) ⇒ Object



125
126
127
128
129
130
131
132
# File 'lib/sakai-info/group.rb', line 125

def self.find_by_group_id(group_id)
  properties = {}
  DB.connect[:sakai_site_group_property].
    where(:group_id => group_id).all.each do |row|
    properties[row[:name]] = row[:value].read
  end
  return properties
end

.get(group_id, property_name) ⇒ Object



115
116
117
118
119
120
121
122
123
# File 'lib/sakai-info/group.rb', line 115

def self.get(group_id, property_name)
  row = DB.connect[:sakai_site_group_property].
    filter(:group_id => group_id, :name => property_name).first
  if row.nil?
    nil
  else
    row[:value].read
  end
end