middleman/middleman — pull request #1060 by mootpointer (2013-10-25 04:42:09+00:00)
Title: Update queryable interface so that it doesn't mutate

Previously, chaining `.where` clauses on middleman would cause the query object to mutate, which mean I couldn't nest scopes without mutating them. This creates a new query whenever you add a `.where`, `.offset`, `.limit` or `.order_by`.

I'm not entirely happy with the implementation, but I was loathe to refactor the whole interface to make this work.