def method_missing(method, *args, &block)
      relationships = self.relationships

      if model.respond_to?(method)
        delegate_to_model(method, *args, &block)
      elsif relationship = relationships[method] || relationships[DataMapper::Inflector.singularize(method.to_s).to_sym]
        delegate_to_relationship(relationship, *args)
      else
        super
      end
    end
def method_missing(method, *args, &block)
      relationships = self.relationships

      if model.respond_to?(method)
        delegate_to_model(method, *args, &block)
      elsif relationship = relationships[method] || relationships[DataMapper::Inflector.singularize(method.to_s).to_sym]
        delegate_to_relationship(relationship, *args)
      else
        super
      end
    end
Delegates to Model, Relationships or the superclass (LazyArray)

 When this receives a method that belongs to the Model the
 Collection is scoped to, it will execute the method within the
 same scope as the Collection and return the results.

 When this receives a method that is a relationship the Model has
 defined, it will execute the association method within the same
 scope as the Collection and return the results.

 Otherwise this method will delegate to a method in the superclass
 (LazyArray) and return the results.

 @return [Object]
   the return values of the delegated methods

 @api public