garybernhardt/raptor — pull request #44 by dpick (2012-03-12 00:39:36+00:00)
Title: don't override default values for parameters

If an argument to a method has a default argument and the injector doesn't have a value for that argument. It should use the default value instead of throwing an exception.

e.g.

Datamapper's all method

def all(query = Undefined)
if query.equal?(Undefined) || (query.kind_of?(Hash) && query.empty?)
# TODO: after adding Enumerable methods to Model, try to return self here
new_collection(self.query.dup)
else
new_collection(scoped_query(query))
end
end