optimize seeding shared domains

With 67k organizations on a local postgres database, this used to take
509 seconds.

Now it takes 0.45 seconds.

[finishes #61496058]

Signed-off-by: Mark Rushakoff <mrushakoff@pivotallabs.com>
don't use EXCEPT as it doesn't work on mysql

Signed-off-by: Mark Rushakoff <mrushakoff@pivotallabs.com>
Normalize spacing
d -> domain

ran the tests this time

Signed-off-by: Mark Rushakoff <mrushakoff@pivotallabs.com>
Added tests for ModelController#find_guid_and_validate_access

* Also removed some inappropriate stubs on the subject

[#60026682]

Signed-off-by: Eric Malm <emalm@pivotallabs.com>
Regrouped controller route bindings.

* Modernized some hashes to 1.9 style.
* Other formatting changes.

Signed-off-by: Eric Malm <emalm@pivotallabs.com>
Concrete ModelControllers implement #delete explicitly.

* ModelController#delete implementation is removed.
* Currently the controllers magically add CRUD methods. We want to move
  away from this and have controllers specify each CRUD method, even if
  that method just calls another helper method.

Signed-off-by: Eric Malm <emalm@pivotallabs.com>
Added the aysnc command to the request params.

Currently not correct see: [#61517340].

[finishes #60026682]

Signed-off-by: Eric Malm <emalm@pivotallabs.com>
Removed rest_controller metaprogramming.

* Concrete controllers inherit directly from ModelController.
* #define_routes must be at the end of the controller class definition to
  avoid shadowing routes defined in the class (sinatra always reads
  routes top to bottom).

Signed-off-by: Eric Malm <emalm@pivotallabs.com>
Move the Snapshot Controller to Services

Signed-off-by: Eric Malm <emalm@pivotallabs.com>
Add 1.9.3 back, and allow failures in for p484 awaiting travis update.

Signed-off-by: Phan Le <ple@pivotallabs.com>
Swap ruby version so that 1.9.3 can hopefully be picked up first

Signed-off-by: Phan Le <ple@pivotallabs.com>
remove dead code

Signed-off-by: Mark Rushakoff <mrushakoff@pivotallabs.com>
Try allow_failures without ruby prefix

Signed-off-by: Phan Le <ple@pivotallabs.com>
Properly escape pagination URLs

This ensures Cloud Controller generates pagination URLs that it can
later consume. Addressable::URI handles proper escaping of query string
values, in particular the semicolons used to separate filter conditions.

This effectively restores #111, which was erroneously reverted by #112.
Merge remote-tracking branch 'upstream/master'