{"action":"opened","number":101,"pull_request":{"url":"https://api.github.com/repos/marionettejs/backbone.syphon/pulls/101","id":31730555,"html_url":"https://github.com/marionettejs/backbone.syphon/pull/101","diff_url":"https://github.com/marionettejs/backbone.syphon/pull/101.diff","patch_url":"https://github.com/marionettejs/backbone.syphon/pull/101.patch","issue_url":"https://api.github.com/repos/marionettejs/backbone.syphon/issues/101","number":101,"state":"open","locked":false,"title":"Serialize multi-select values as an array","user":{"login":"patrickbajao","id":383183,"avatar_url":"https://avatars.githubusercontent.com/u/383183?v=3","gravatar_id":"","url":"https://api.github.com/users/patrickbajao","html_url":"https://github.com/patrickbajao","followers_url":"https://api.github.com/users/patrickbajao/followers","following_url":"https://api.github.com/users/patrickbajao/following{/other_user}","gists_url":"https://api.github.com/users/patrickbajao/gists{/gist_id}","starred_url":"https://api.github.com/users/patrickbajao/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/patrickbajao/subscriptions","organizations_url":"https://api.github.com/users/patrickbajao/orgs","repos_url":"https://api.github.com/users/patrickbajao/repos","events_url":"https://api.github.com/users/patrickbajao/events{/privacy}","received_events_url":"https://api.github.com/users/patrickbajao/received_events","type":"User","site_admin":false},"body":"Hi,\r\n\r\nI have a multi-select in one of my forms. I started using Backbone.Syphon to serialize that form and I realized that it wasn't returning the values I am expecting. Before this change, it's returning the values of a multi-select in a nested array:\r\n\r\n```javascript\r\n[\r\n  [\r\n    \"bar1\",\r\n    \"bar2\"\r\n  ]\r\n]\r\n```\r\n\r\nWhen submitting this format of serialized data to my backend (using Rails) via AJAX, the URL encoded value will be `foo%5B0%5D%5B%5D=bar1&foo%5B0%5D%5B%5D=bar2`. That looks weird and that's not what I am expecting.\r\n\r\nMy expected output is:\r\n\r\n```javascript\r\n[\r\n  \"bar1\",\r\n  \"bar2\"\r\n]\r\n```\r\n\r\nWhich will be `foo%5B%5D=bar1&foo%5B%5D=bar2` when URL encoded.\r\n\r\nRegarding the fix found in this pull request, I updated the `assignKeyValue` method to push each value into the array instead of pushing the array into an array to avoid the nested array output. I also added a spec for that and hopefully that helps in explaining my case further. All tests are still passing with these changes.\r\n\r\nIf I'm still missing something or if I need to change something else, please let me know. :)\r\n\r\nThanks,\r\nPatrick","created_at":"2015-03-23T13:16:13Z","updated_at":"2015-03-23T13:16:13Z","closed_at":null,"merged_at":null,"merge_commit_sha":"788db42a3b2817d2b8b22e1d4678aa9ed37ec04c","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/marionettejs/backbone.syphon/pulls/101/commits","review_comments_url":"https://api.github.com/repos/marionettejs/backbone.syphon/pulls/101/comments","review_comment_url":"https://api.github.com/repos/marionettejs/backbone.syphon/pulls/comments{/number}","comments_url":"https://api.github.com/repos/marionettejs/backbone.syphon/issues/101/comments","statuses_url":"https://api.github.com/repos/marionettejs/backbone.syphon/statuses/e270f39e295fd26c253c903097bb07d9d6572448","head":{"label":"patrickbajao:multi-select-serialize","ref":"multi-select-serialize","sha":"e270f39e295fd26c253c903097bb07d9d6572448","user":{"login":"patrickbajao","id":383183,"avatar_url":"https://avatars.githubusercontent.com/u/383183?v=3","gravatar_id":"","url":"https://api.github.com/users/patrickbajao","html_url":"https://github.com/patrickbajao","followers_url":"https://api.github.com/users/patrickbajao/followers","following_url":"https://api.github.com/users/patrickbajao/following{/other_user}","gists_url":"https://api.github.com/users/patrickbajao/gists{/gist_id}","starred_url":"https://api.github.com/users/patrickbajao/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/patrickbajao/subscriptions","organizations_url":"https://api.github.com/users/patrickbajao/orgs","repos_url":"https://api.github.com/users/patrickbajao/repos","events_url":"https://api.github.com/users/patrickbajao/events{/privacy}","received_events_url":"https://api.github.com/users/patrickbajao/received_events","type":"User","site_admin":false},"repo":{"id":32726331,"name":"backbone.syphon","full_name":"patrickbajao/backbone.syphon","owner":{"login":"patrickbajao","id":383183,"avatar_url":"https://avatars.githubusercontent.com/u/383183?v=3","gravatar_id":"","url":"https://api.github.com/users/patrickbajao","html_url":"https://github.com/patrickbajao","followers_url":"https://api.github.com/users/patrickbajao/followers","following_url":"https://api.github.com/users/patrickbajao/following{/other_user}","gists_url":"https://api.github.com/users/patrickbajao/gists{/gist_id}","starred_url":"https://api.github.com/users/patrickbajao/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/patrickbajao/subscriptions","organizations_url":"https://api.github.com/users/patrickbajao/orgs","repos_url":"https://api.github.com/users/patrickbajao/repos","events_url":"https://api.github.com/users/patrickbajao/events{/privacy}","received_events_url":"https://api.github.com/users/patrickbajao/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/patrickbajao/backbone.syphon","description":"Serialize a Backbone.View in to a JavaScript object.","fork":true,"url":"https://api.github.com/repos/patrickbajao/backbone.syphon","forks_url":"https://api.github.com/repos/patrickbajao/backbone.syphon/forks","keys_url":"https://api.github.com/repos/patrickbajao/backbone.syphon/keys{/key_id}","collaborators_url":"https://api.github.com/repos/patrickbajao/backbone.syphon/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/patrickbajao/backbone.syphon/teams","hooks_url":"https://api.github.com/repos/patrickbajao/backbone.syphon/hooks","issue_events_url":"https://api.github.com/repos/patrickbajao/backbone.syphon/issues/events{/number}","events_url":"https://api.github.com/repos/patrickbajao/backbone.syphon/events","assignees_url":"https://api.github.com/repos/patrickbajao/backbone.syphon/assignees{/user}","branches_url":"https://api.github.com/repos/patrickbajao/backbone.syphon/branches{/branch}","tags_url":"https://api.github.com/repos/patrickbajao/backbone.syphon/tags","blobs_url":"https://api.github.com/repos/patrickbajao/backbone.syphon/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/patrickbajao/backbone.syphon/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/patrickbajao/backbone.syphon/git/refs{/sha}","trees_url":"https://api.github.com/repos/patrickbajao/backbone.syphon/git/trees{/sha}","statuses_url":"https://api.github.com/repos/patrickbajao/backbone.syphon/statuses/{sha}","languages_url":"https://api.github.com/repos/patrickbajao/backbone.syphon/languages","stargazers_url":"https://api.github.com/repos/patrickbajao/backbone.syphon/stargazers","contributors_url":"https://api.github.com/repos/patrickbajao/backbone.syphon/contributors","subscribers_url":"https://api.github.com/repos/patrickbajao/backbone.syphon/subscribers","subscription_url":"https://api.github.com/repos/patrickbajao/backbone.syphon/subscription","commits_url":"https://api.github.com/repos/patrickbajao/backbone.syphon/commits{/sha}","git_commits_url":"https://api.github.com/repos/patrickbajao/backbone.syphon/git/commits{/sha}","comments_url":"https://api.github.com/repos/patrickbajao/backbone.syphon/comments{/number}","issue_comment_url":"https://api.github.com/repos/patrickbajao/backbone.syphon/issues/comments{/number}","contents_url":"https://api.github.com/repos/patrickbajao/backbone.syphon/contents/{+path}","compare_url":"https://api.github.com/repos/patrickbajao/backbone.syphon/compare/{base}...{head}","merges_url":"https://api.github.com/repos/patrickbajao/backbone.syphon/merges","archive_url":"https://api.github.com/repos/patrickbajao/backbone.syphon/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/patrickbajao/backbone.syphon/downloads","issues_url":"https://api.github.com/repos/patrickbajao/backbone.syphon/issues{/number}","pulls_url":"https://api.github.com/repos/patrickbajao/backbone.syphon/pulls{/number}","milestones_url":"https://api.github.com/repos/patrickbajao/backbone.syphon/milestones{/number}","notifications_url":"https://api.github.com/repos/patrickbajao/backbone.syphon/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/patrickbajao/backbone.syphon/labels{/name}","releases_url":"https://api.github.com/repos/patrickbajao/backbone.syphon/releases{/id}","created_at":"2015-03-23T10:49:04Z","updated_at":"2015-03-23T10:49:05Z","pushed_at":"2015-03-23T12:44:51Z","git_url":"git://github.com/patrickbajao/backbone.syphon.git","ssh_url":"git@github.com:patrickbajao/backbone.syphon.git","clone_url":"https://github.com/patrickbajao/backbone.syphon.git","svn_url":"https://github.com/patrickbajao/backbone.syphon","homepage":"","size":1067,"stargazers_count":0,"watchers_count":0,"language":"JavaScript","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"marionettejs:minor","ref":"minor","sha":"05598004f54d0b2eca96bed76010f65c4b84880c","user":{"login":"marionettejs","id":2273169,"avatar_url":"https://avatars.githubusercontent.com/u/2273169?v=3","gravatar_id":"","url":"https://api.github.com/users/marionettejs","html_url":"https://github.com/marionettejs","followers_url":"https://api.github.com/users/marionettejs/followers","following_url":"https://api.github.com/users/marionettejs/following{/other_user}","gists_url":"https://api.github.com/users/marionettejs/gists{/gist_id}","starred_url":"https://api.github.com/users/marionettejs/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/marionettejs/subscriptions","organizations_url":"https://api.github.com/users/marionettejs/orgs","repos_url":"https://api.github.com/users/marionettejs/repos","events_url":"https://api.github.com/users/marionettejs/events{/privacy}","received_events_url":"https://api.github.com/users/marionettejs/received_events","type":"Organization","site_admin":false},"repo":{"id":4339563,"name":"backbone.syphon","full_name":"marionettejs/backbone.syphon","owner":{"login":"marionettejs","id":2273169,"avatar_url":"https://avatars.githubusercontent.com/u/2273169?v=3","gravatar_id":"","url":"https://api.github.com/users/marionettejs","html_url":"https://github.com/marionettejs","followers_url":"https://api.github.com/users/marionettejs/followers","following_url":"https://api.github.com/users/marionettejs/following{/other_user}","gists_url":"https://api.github.com/users/marionettejs/gists{/gist_id}","starred_url":"https://api.github.com/users/marionettejs/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/marionettejs/subscriptions","organizations_url":"https://api.github.com/users/marionettejs/orgs","repos_url":"https://api.github.com/users/marionettejs/repos","events_url":"https://api.github.com/users/marionettejs/events{/privacy}","received_events_url":"https://api.github.com/users/marionettejs/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/marionettejs/backbone.syphon","description":"Serialize a Backbone.View in to a JavaScript object.","fork":false,"url":"https://api.github.com/repos/marionettejs/backbone.syphon","forks_url":"https://api.github.com/repos/marionettejs/backbone.syphon/forks","keys_url":"https://api.github.com/repos/marionettejs/backbone.syphon/keys{/key_id}","collaborators_url":"https://api.github.com/repos/marionettejs/backbone.syphon/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/marionettejs/backbone.syphon/teams","hooks_url":"https://api.github.com/repos/marionettejs/backbone.syphon/hooks","issue_events_url":"https://api.github.com/repos/marionettejs/backbone.syphon/issues/events{/number}","events_url":"https://api.github.com/repos/marionettejs/backbone.syphon/events","assignees_url":"https://api.github.com/repos/marionettejs/backbone.syphon/assignees{/user}","branches_url":"https://api.github.com/repos/marionettejs/backbone.syphon/branches{/branch}","tags_url":"https://api.github.com/repos/marionettejs/backbone.syphon/tags","blobs_url":"https://api.github.com/repos/marionettejs/backbone.syphon/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/marionettejs/backbone.syphon/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/marionettejs/backbone.syphon/git/refs{/sha}","trees_url":"https://api.github.com/repos/marionettejs/backbone.syphon/git/trees{/sha}","statuses_url":"https://api.github.com/repos/marionettejs/backbone.syphon/statuses/{sha}","languages_url":"https://api.github.com/repos/marionettejs/backbone.syphon/languages","stargazers_url":"https://api.github.com/repos/marionettejs/backbone.syphon/stargazers","contributors_url":"https://api.github.com/repos/marionettejs/backbone.syphon/contributors","subscribers_url":"https://api.github.com/repos/marionettejs/backbone.syphon/subscribers","subscription_url":"https://api.github.com/repos/marionettejs/backbone.syphon/subscription","commits_url":"https://api.github.com/repos/marionettejs/backbone.syphon/commits{/sha}","git_commits_url":"https://api.github.com/repos/marionettejs/backbone.syphon/git/commits{/sha}","comments_url":"https://api.github.com/repos/marionettejs/backbone.syphon/comments{/number}","issue_comment_url":"https://api.github.com/repos/marionettejs/backbone.syphon/issues/comments{/number}","contents_url":"https://api.github.com/repos/marionettejs/backbone.syphon/contents/{+path}","compare_url":"https://api.github.com/repos/marionettejs/backbone.syphon/compare/{base}...{head}","merges_url":"https://api.github.com/repos/marionettejs/backbone.syphon/merges","archive_url":"https://api.github.com/repos/marionettejs/backbone.syphon/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/marionettejs/backbone.syphon/downloads","issues_url":"https://api.github.com/repos/marionettejs/backbone.syphon/issues{/number}","pulls_url":"https://api.github.com/repos/marionettejs/backbone.syphon/pulls{/number}","milestones_url":"https://api.github.com/repos/marionettejs/backbone.syphon/milestones{/number}","notifications_url":"https://api.github.com/repos/marionettejs/backbone.syphon/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/marionettejs/backbone.syphon/labels{/name}","releases_url":"https://api.github.com/repos/marionettejs/backbone.syphon/releases{/id}","created_at":"2012-05-15T19:14:54Z","updated_at":"2015-03-20T08:37:27Z","pushed_at":"2015-03-23T13:16:13Z","git_url":"git://github.com/marionettejs/backbone.syphon.git","ssh_url":"git@github.com:marionettejs/backbone.syphon.git","clone_url":"https://github.com/marionettejs/backbone.syphon.git","svn_url":"https://github.com/marionettejs/backbone.syphon","homepage":"","size":1067,"stargazers_count":437,"watchers_count":437,"language":"JavaScript","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":75,"mirror_url":null,"open_issues_count":11,"forks":75,"open_issues":11,"watchers":437,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/marionettejs/backbone.syphon/pulls/101"},"html":{"href":"https://github.com/marionettejs/backbone.syphon/pull/101"},"issue":{"href":"https://api.github.com/repos/marionettejs/backbone.syphon/issues/101"},"comments":{"href":"https://api.github.com/repos/marionettejs/backbone.syphon/issues/101/comments"},"review_comments":{"href":"https://api.github.com/repos/marionettejs/backbone.syphon/pulls/101/comments"},"review_comment":{"href":"https://api.github.com/repos/marionettejs/backbone.syphon/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/marionettejs/backbone.syphon/pulls/101/commits"},"statuses":{"href":"https://api.github.com/repos/marionettejs/backbone.syphon/statuses/e270f39e295fd26c253c903097bb07d9d6572448"}},"merged":false,"mergeable":true,"mergeable_state":"clean","merged_by":null,"comments":0,"review_comments":0,"commits":1,"additions":37,"deletions":6,"changed_files":2}}