https://github.com/andrewarrow/bug_jan_14
rails project with a weird bug
https://github.com/andrewarrow/bug_jan_14
Last synced: about 1 month ago
JSON representation
rails project with a weird bug
- Host: GitHub
- URL: https://github.com/andrewarrow/bug_jan_14
- Owner: andrewarrow
- Created: 2016-01-15T00:51:15.000Z (over 10 years ago)
- Default Branch: master
- Last Pushed: 2016-01-15T09:32:43.000Z (over 10 years ago)
- Last Synced: 2025-03-02T10:22:41.908Z (over 1 year ago)
- Language: Ruby
- Size: 20.5 KB
- Stars: 0
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
Seed the db with:
```
User.create(name: 'Robert', display_name: 'Bob')
Thing.create(name: 'Thing1', flavor: 'Ruby', magic_number: 15, user_id: 1)
```
And then run `curl` piped to `jq`:
```
curl http://localhost:3000/api/test | jq
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
100 135 100 135 0 0 2055 0 --:--:-- --:--:-- --:--:-- 2076
{
"results": [
{
"created_at": 1452817066,
"id": 1,
"display_name": "Bob",
"magic_number": 15,
"flavor": "Ruby",
"name": [
"Robert",
"Bob",
15,
"Ruby"
]
}
]
}
```
Look at https://github.com/andrewarrow/bug_jan_14/blob/master/app/models/thing.rb as_json method. Do you see the bug? Why is name an array vs. just "Robert"?