Skip to content

Instantly share code, notes, and snippets.

View jgorset's full-sized avatar

Johannes Gorset jgorset

View GitHub Profile
@jgorset
jgorset / gist:4237588
Created December 7, 2012 23:47
Rooms...
# Load all rooms.
#
# Returns an array of hashes describing each room.
def all
devices = Device.all
rooms = []
# Go through each device, check wich room it belongs
# do, if the room does not exist, add it to rooms, if
# just add this device to the list of devices