{"action":"created","issue":{"url":"https://api.github.com/repos/danielspaniel/ember-data-factory-guy/issues/108","labels_url":"https://api.github.com/repos/danielspaniel/ember-data-factory-guy/issues/108/labels{/name}","comments_url":"https://api.github.com/repos/danielspaniel/ember-data-factory-guy/issues/108/comments","events_url":"https://api.github.com/repos/danielspaniel/ember-data-factory-guy/issues/108/events","html_url":"https://github.com/danielspaniel/ember-data-factory-guy/issues/108","id":96081776,"number":108,"title":"Building data attributes for JSONAPIAdapter not working as expected","user":{"login":"davetheninja","id":117323,"avatar_url":"https://avatars.githubusercontent.com/u/117323?v=3","gravatar_id":"","url":"https://api.github.com/users/davetheninja","html_url":"https://github.com/davetheninja","followers_url":"https://api.github.com/users/davetheninja/followers","following_url":"https://api.github.com/users/davetheninja/following{/other_user}","gists_url":"https://api.github.com/users/davetheninja/gists{/gist_id}","starred_url":"https://api.github.com/users/davetheninja/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/davetheninja/subscriptions","organizations_url":"https://api.github.com/users/davetheninja/orgs","repos_url":"https://api.github.com/users/davetheninja/repos","events_url":"https://api.github.com/users/davetheninja/events{/privacy}","received_events_url":"https://api.github.com/users/davetheninja/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":24,"created_at":"2015-07-20T14:51:38Z","updated_at":"2015-07-24T16:29:46Z","closed_at":null,"body":"Firstly, apologies for being AWOL for the require.js pull request. Family and work have kept me offline for the last while.\r\n\r\nThe issue:\r\n\r\nWhen factory_guy is building the mockjax response for the JSONAPIAdapter it is building the attributes section in the same camelCasing as the models field names.\r\n\r\nSo, instead of say:\r\n\r\n```javascript\r\nattributes: {\r\n  'first-name': 'David'\r\n}\r\n```\r\n\r\nIt is generating:\r\n\r\n```javascript\r\nattributes: {\r\n  firstName: 'David'\r\n}\r\n```\r\n\r\nWhen this happens, Ember's JSONAPISerializer ignores the attribute as it is expecting the hyphenated version.\r\n\r\nI am wondering if a) I am missing something obvious or b) its a bug.\r\n\r\nIf its a bug I would be more than happy to help fix it, however I would like to discuss the best way (in your opinion) to go about it.\r\n\r\nThanks again."},"comment":{"url":"https://api.github.com/repos/danielspaniel/ember-data-factory-guy/issues/comments/124573458","html_url":"https://github.com/danielspaniel/ember-data-factory-guy/issues/108#issuecomment-124573458","issue_url":"https://api.github.com/repos/danielspaniel/ember-data-factory-guy/issues/108","id":124573458,"user":{"login":"davetheninja","id":117323,"avatar_url":"https://avatars.githubusercontent.com/u/117323?v=3","gravatar_id":"","url":"https://api.github.com/users/davetheninja","html_url":"https://github.com/davetheninja","followers_url":"https://api.github.com/users/davetheninja/followers","following_url":"https://api.github.com/users/davetheninja/following{/other_user}","gists_url":"https://api.github.com/users/davetheninja/gists{/gist_id}","starred_url":"https://api.github.com/users/davetheninja/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/davetheninja/subscriptions","organizations_url":"https://api.github.com/users/davetheninja/orgs","repos_url":"https://api.github.com/users/davetheninja/repos","events_url":"https://api.github.com/users/davetheninja/events{/privacy}","received_events_url":"https://api.github.com/users/davetheninja/received_events","type":"User","site_admin":false},"created_at":"2015-07-24T16:29:46Z","updated_at":"2015-07-24T16:29:46Z","body":"I think I know why the tests (i just wrote on the helper) are not failing.\nIts retrieving directly from factory guy profile.\n\nI am going to write a quick acceptance test to confirm.\n\nOn 25 July 2015 at 00:19, linstula <notifications@github.com> wrote:\n\n> I actually wasn't using the testHelpers - I was building a JSON response\n> with FactoryGuy.build (using the JSONAPIAdapter) and sending that payload\n> back with Pretender <https://github.com/trek/pretender>. the\n> relationships and attributes that were camelCased had values of undefined\n> on the resulting model instances.\n>\n> I did some digging and this seems to be a known case for the\n> JSONAPISerializer (the issue is about the serializer not handling\n> underscored keys but bmac mentions that, by default, the serializer expects\n> dasherized keys): emberjs/data#3455\n> <https://github.com/emberjs/data/issues/3455>\n>\n> Unsure why the tests are passing though :/. I haven't looked too deeply\n> into the code but I suspect the tests may be pushing records directly into\n> the store and side stepping part of the normal flow for turning a json\n> payload into a model instance.\n>\n> —\n> Reply to this email directly or view it on GitHub\n> <https://github.com/danielspaniel/ember-data-factory-guy/issues/108#issuecomment-124571364>\n> .\n>\n\n\n\n-- \n\"I am not able to rightly apprehend the kind of confusion of ideas that\ncould provoke such a question.\" -- Charles Babbage\n"}}