lib/storable.js
function(cls) {
      
      if (this.collection) {
        return this.collection;
      }
      
      cls = (cls) ? this.superclass(cls) : this;

      while(cls) {
        if (cls.collection) {
          this.collection = cls.collection;
          return cls.collection;
        }
      }
      
      return false;
    }
function(cls) {
      
      if (this.collection) {
        return this.collection;
      }
      
      cls = (cls) ? this.superclass(cls) : this;

      while(cls) {
        if (cls.collection) {
          this.collection = cls.collection;
          return cls.collection;
        }
      }
      
      return false;
    }
/*
Function: getCollection
Looks for a collection object attached to the current class. If one is not
found, it traverses the ancestor tree looking for the closest class that
has a collection object associated with it, and returns that collection.

Parameters:
cls - (Optional) A class in the ancestor hierarchy to start the serach with.
If none is provided, the search will start with the current class.

Returns:
A collection object if one is found, or false.