{"action":"opened","issue":{"url":"https://api.github.com/repos/colinskow/superlogin/issues/19","labels_url":"https://api.github.com/repos/colinskow/superlogin/issues/19/labels{/name}","comments_url":"https://api.github.com/repos/colinskow/superlogin/issues/19/comments","events_url":"https://api.github.com/repos/colinskow/superlogin/issues/19/events","html_url":"https://github.com/colinskow/superlogin/issues/19","id":124022357,"number":19,"title":"userModel is not extended correctly","user":{"login":"raymatos","id":832789,"avatar_url":"https://avatars.githubusercontent.com/u/832789?v=3","gravatar_id":"","url":"https://api.github.com/users/raymatos","html_url":"https://github.com/raymatos","followers_url":"https://api.github.com/users/raymatos/followers","following_url":"https://api.github.com/users/raymatos/following{/other_user}","gists_url":"https://api.github.com/users/raymatos/gists{/gist_id}","starred_url":"https://api.github.com/users/raymatos/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/raymatos/subscriptions","organizations_url":"https://api.github.com/users/raymatos/orgs","repos_url":"https://api.github.com/users/raymatos/repos","events_url":"https://api.github.com/users/raymatos/events{/privacy}","received_events_url":"https://api.github.com/users/raymatos/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":0,"created_at":"2015-12-28T05:52:25Z","updated_at":"2015-12-28T05:52:25Z","closed_at":null,"body":"When extending the user model, nested arrays are not concatenated their positions are overwritten.\r\n\r\nie: \r\n\r\n```\r\nvar userModelConfig = {whitelist: ['1','2','3','4','5','6']}\r\nvar userModel = {whitelist: ['a','b','c']}\r\n\r\n$.extend(true, {}, userModel, userModelConfig)\r\n//returns\r\n{\"whitelist\":[\"1\",\"2\",\"3\",\"4\",\"5\",\"6\"]}\r\n\r\nand\r\n$.extend(true, {}, userModelConfig, userModel)\r\n\"{\"whitelist\":[\"a\",\"b\",\"c\",\"4\",\"5\",\"6\"]}\"\r\n```\r\n\r\nAs you can see the index position of the array is overwritten rather then extend or merged.\r\n\r\nA potential solution would be to transform the arrays into objects, extend them and transform them back.  \r\n\r\nI was going to try to fix it and submit a pull request, but i dont have the time tonight so i wanted to get this to you, maybe you have a quicker solution. \r\n"}}