mdsol/moya — pull request #10 by csavage-mdsol (2014-12-09 22:34:48+00:00)
Title: [MCC-139310] Feature/moya

Sorry about the mega PR. I haven't really thought of how swap an app in bite size chunks. This gets the previous specs working with a new rails app, so it basically implements a simplified index, a show, and a root, as well as the magic for external initializers. I changed a few things about the drd model. I changed ``` uuid ``` to ``` id ``` because I always thought "I don't care that its a uuid, its an id that happens to be a uuid". To this end, I also included ActiveUUID which seemed like a moderately good idea. I also changed ``` built_at ``` to ``` created_at ``` so we could just use timestamps like normal people.

A few weird things popped up during this:
1) Crichton has a terrible error if your api descriptors aren't where it is expecting them. it raises an ``` undefined method transitions on nil ```
2) The ActiveUUID thing started requiring an actual UUID object at some point. Not sure what I broke. It should take a string. Left a todo for a fix.
3) On the index route, I noticed that if you hand crichton a ```{ state: :collection} ``` option it would pass that option on to the drds in ``` items ```, which would explode, because there isn't a state ``` collection ```. Probably related to the cascading permissions issue.
4) If you hand an ActiveRecord::Relation in instead of an array of instantiated objects, things go boom.

Opened against develop, but I created a branch ``` crichton_test_service ``` that we can keep using until Moya is ready to starburst.

Comments and criticism most welcome. I'd like us to like this.
@yzhangmedidata @HonoreDB @sheavalentine-mdsol

```
Finished in 33.14 seconds (files took 0.99444 seconds to load)
12 examples, 0 failures, 6 pending
```