faradayio/hangar — pull request #2 by ihough (2014-06-20 15:29:01+00:00)
Title: #create should return all attributes of the created object

@rossmeissl: I could not replicate this in a spec, but I have a situation where `factory.to_json != factory.attributes.to_json`:
```
> h = FactoryGirl.create(:household, the_geom_wkt_4326:"POINT(-73.1936 44.4775)")
> puts h.to_json
{"id":"foo","person":"The Dude"}

> puts h.attributes.to_json
{"id":"foo","person":"The Dude","the_geom":"SOMEGEOM"}
```
I need the missing attribute (here `the_geom`) to be returned by `Hangar#create` so that I can pass it to another factory:
```
household = POST /households, { "household": { "the_geom_wkt_4326":"POINT(-73.1936 44.4775)" } }
investor = POST /investors, { "investor": { "the_geom":"#{household.the_geom}" } }
```

This was my solution. Alternatively I could edit my `Investor` model so that it accepts `the_geom_wkt_4326` and automatically transforms it to `the_geom`.