{"action":"closed","number":199,"pull_request":{"url":"https://api.github.com/repos/apotonick/reform/pulls/199","id":28871224,"html_url":"https://github.com/apotonick/reform/pull/199","diff_url":"https://github.com/apotonick/reform/pull/199.diff","patch_url":"https://github.com/apotonick/reform/pull/199.patch","issue_url":"https://api.github.com/repos/apotonick/reform/issues/199","number":199,"state":"closed","locked":false,"title":"Make namespaced forms return model for #to_model.","user":{"login":"posgarou","id":8039360,"avatar_url":"https://avatars.githubusercontent.com/u/8039360?v=3","gravatar_id":"","url":"https://api.github.com/users/posgarou","html_url":"https://github.com/posgarou","followers_url":"https://api.github.com/users/posgarou/followers","following_url":"https://api.github.com/users/posgarou/following{/other_user}","gists_url":"https://api.github.com/users/posgarou/gists{/gist_id}","starred_url":"https://api.github.com/users/posgarou/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/posgarou/subscriptions","organizations_url":"https://api.github.com/users/posgarou/orgs","repos_url":"https://api.github.com/users/posgarou/repos","events_url":"https://api.github.com/users/posgarou/events{/privacy}","received_events_url":"https://api.github.com/users/posgarou/received_events","type":"User","site_admin":false},"body":"While working with this basic setup today\r\n\r\n```ruby\r\nclass PostForm < Reform::Form\r\n\r\n  class Admin < PostForm; end\r\n\r\n  class Normal < PostForm; end\r\n\r\n  # def to_model\r\n  #   model\r\n  # end\r\nend\r\n```\r\n\r\nI discovered that when sending my view a PostForm::Normal instance, the path generated for the form action (`= form_for @form do |post_form|`) was defaulting to `post_form_normals_path`.  After some digging, I found that this was due to `#to_model` and that uncommenting the above-defined `#to_model` method gave the expected behavior.\r\n\r\nThis change implements the expected behavior for non-composed forms and preserves the existing behavior for composed forms.","created_at":"2015-02-07T22:20:21Z","updated_at":"2016-07-05T12:47:56Z","closed_at":"2016-07-05T12:47:56Z","merged_at":null,"merge_commit_sha":"246e852e1959b31297eadbb36e0fab0e16ec844c","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/apotonick/reform/pulls/199/commits","review_comments_url":"https://api.github.com/repos/apotonick/reform/pulls/199/comments","review_comment_url":"https://api.github.com/repos/apotonick/reform/pulls/comments{/number}","comments_url":"https://api.github.com/repos/apotonick/reform/issues/199/comments","statuses_url":"https://api.github.com/repos/apotonick/reform/statuses/427940c7d1f43b82f68acbb3b71d1802fb220874","head":{"label":"posgarou:bugfix/to_model_in_active_model","ref":"bugfix/to_model_in_active_model","sha":"427940c7d1f43b82f68acbb3b71d1802fb220874","user":{"login":"posgarou","id":8039360,"avatar_url":"https://avatars.githubusercontent.com/u/8039360?v=3","gravatar_id":"","url":"https://api.github.com/users/posgarou","html_url":"https://github.com/posgarou","followers_url":"https://api.github.com/users/posgarou/followers","following_url":"https://api.github.com/users/posgarou/following{/other_user}","gists_url":"https://api.github.com/users/posgarou/gists{/gist_id}","starred_url":"https://api.github.com/users/posgarou/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/posgarou/subscriptions","organizations_url":"https://api.github.com/users/posgarou/orgs","repos_url":"https://api.github.com/users/posgarou/repos","events_url":"https://api.github.com/users/posgarou/events{/privacy}","received_events_url":"https://api.github.com/users/posgarou/received_events","type":"User","site_admin":false},"repo":{"id":30057208,"name":"reform","full_name":"posgarou/reform","owner":{"login":"posgarou","id":8039360,"avatar_url":"https://avatars.githubusercontent.com/u/8039360?v=3","gravatar_id":"","url":"https://api.github.com/users/posgarou","html_url":"https://github.com/posgarou","followers_url":"https://api.github.com/users/posgarou/followers","following_url":"https://api.github.com/users/posgarou/following{/other_user}","gists_url":"https://api.github.com/users/posgarou/gists{/gist_id}","starred_url":"https://api.github.com/users/posgarou/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/posgarou/subscriptions","organizations_url":"https://api.github.com/users/posgarou/orgs","repos_url":"https://api.github.com/users/posgarou/repos","events_url":"https://api.github.com/users/posgarou/events{/privacy}","received_events_url":"https://api.github.com/users/posgarou/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/posgarou/reform","description":"Form objects decoupled from models.","fork":true,"url":"https://api.github.com/repos/posgarou/reform","forks_url":"https://api.github.com/repos/posgarou/reform/forks","keys_url":"https://api.github.com/repos/posgarou/reform/keys{/key_id}","collaborators_url":"https://api.github.com/repos/posgarou/reform/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/posgarou/reform/teams","hooks_url":"https://api.github.com/repos/posgarou/reform/hooks","issue_events_url":"https://api.github.com/repos/posgarou/reform/issues/events{/number}","events_url":"https://api.github.com/repos/posgarou/reform/events","assignees_url":"https://api.github.com/repos/posgarou/reform/assignees{/user}","branches_url":"https://api.github.com/repos/posgarou/reform/branches{/branch}","tags_url":"https://api.github.com/repos/posgarou/reform/tags","blobs_url":"https://api.github.com/repos/posgarou/reform/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/posgarou/reform/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/posgarou/reform/git/refs{/sha}","trees_url":"https://api.github.com/repos/posgarou/reform/git/trees{/sha}","statuses_url":"https://api.github.com/repos/posgarou/reform/statuses/{sha}","languages_url":"https://api.github.com/repos/posgarou/reform/languages","stargazers_url":"https://api.github.com/repos/posgarou/reform/stargazers","contributors_url":"https://api.github.com/repos/posgarou/reform/contributors","subscribers_url":"https://api.github.com/repos/posgarou/reform/subscribers","subscription_url":"https://api.github.com/repos/posgarou/reform/subscription","commits_url":"https://api.github.com/repos/posgarou/reform/commits{/sha}","git_commits_url":"https://api.github.com/repos/posgarou/reform/git/commits{/sha}","comments_url":"https://api.github.com/repos/posgarou/reform/comments{/number}","issue_comment_url":"https://api.github.com/repos/posgarou/reform/issues/comments{/number}","contents_url":"https://api.github.com/repos/posgarou/reform/contents/{+path}","compare_url":"https://api.github.com/repos/posgarou/reform/compare/{base}...{head}","merges_url":"https://api.github.com/repos/posgarou/reform/merges","archive_url":"https://api.github.com/repos/posgarou/reform/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/posgarou/reform/downloads","issues_url":"https://api.github.com/repos/posgarou/reform/issues{/number}","pulls_url":"https://api.github.com/repos/posgarou/reform/pulls{/number}","milestones_url":"https://api.github.com/repos/posgarou/reform/milestones{/number}","notifications_url":"https://api.github.com/repos/posgarou/reform/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/posgarou/reform/labels{/name}","releases_url":"https://api.github.com/repos/posgarou/reform/releases{/id}","deployments_url":"https://api.github.com/repos/posgarou/reform/deployments","created_at":"2015-01-30T05:09:52Z","updated_at":"2015-01-30T05:09:54Z","pushed_at":"2015-04-15T23:18:02Z","git_url":"git://github.com/posgarou/reform.git","ssh_url":"git@github.com:posgarou/reform.git","clone_url":"https://github.com/posgarou/reform.git","svn_url":"https://github.com/posgarou/reform","homepage":"","size":1022,"stargazers_count":0,"watchers_count":0,"language":"Ruby","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":"apotonick:master","ref":"master","sha":"79f1e45d6aebdf1aef67383a8b1a0eea3bfcb324","user":{"login":"apotonick","id":10406,"avatar_url":"https://avatars.githubusercontent.com/u/10406?v=3","gravatar_id":"","url":"https://api.github.com/users/apotonick","html_url":"https://github.com/apotonick","followers_url":"https://api.github.com/users/apotonick/followers","following_url":"https://api.github.com/users/apotonick/following{/other_user}","gists_url":"https://api.github.com/users/apotonick/gists{/gist_id}","starred_url":"https://api.github.com/users/apotonick/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/apotonick/subscriptions","organizations_url":"https://api.github.com/users/apotonick/orgs","repos_url":"https://api.github.com/users/apotonick/repos","events_url":"https://api.github.com/users/apotonick/events{/privacy}","received_events_url":"https://api.github.com/users/apotonick/received_events","type":"User","site_admin":false},"repo":{"id":9764362,"name":"reform","full_name":"apotonick/reform","owner":{"login":"apotonick","id":10406,"avatar_url":"https://avatars.githubusercontent.com/u/10406?v=3","gravatar_id":"","url":"https://api.github.com/users/apotonick","html_url":"https://github.com/apotonick","followers_url":"https://api.github.com/users/apotonick/followers","following_url":"https://api.github.com/users/apotonick/following{/other_user}","gists_url":"https://api.github.com/users/apotonick/gists{/gist_id}","starred_url":"https://api.github.com/users/apotonick/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/apotonick/subscriptions","organizations_url":"https://api.github.com/users/apotonick/orgs","repos_url":"https://api.github.com/users/apotonick/repos","events_url":"https://api.github.com/users/apotonick/events{/privacy}","received_events_url":"https://api.github.com/users/apotonick/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/apotonick/reform","description":"Form objects decoupled from models.","fork":false,"url":"https://api.github.com/repos/apotonick/reform","forks_url":"https://api.github.com/repos/apotonick/reform/forks","keys_url":"https://api.github.com/repos/apotonick/reform/keys{/key_id}","collaborators_url":"https://api.github.com/repos/apotonick/reform/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/apotonick/reform/teams","hooks_url":"https://api.github.com/repos/apotonick/reform/hooks","issue_events_url":"https://api.github.com/repos/apotonick/reform/issues/events{/number}","events_url":"https://api.github.com/repos/apotonick/reform/events","assignees_url":"https://api.github.com/repos/apotonick/reform/assignees{/user}","branches_url":"https://api.github.com/repos/apotonick/reform/branches{/branch}","tags_url":"https://api.github.com/repos/apotonick/reform/tags","blobs_url":"https://api.github.com/repos/apotonick/reform/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/apotonick/reform/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/apotonick/reform/git/refs{/sha}","trees_url":"https://api.github.com/repos/apotonick/reform/git/trees{/sha}","statuses_url":"https://api.github.com/repos/apotonick/reform/statuses/{sha}","languages_url":"https://api.github.com/repos/apotonick/reform/languages","stargazers_url":"https://api.github.com/repos/apotonick/reform/stargazers","contributors_url":"https://api.github.com/repos/apotonick/reform/contributors","subscribers_url":"https://api.github.com/repos/apotonick/reform/subscribers","subscription_url":"https://api.github.com/repos/apotonick/reform/subscription","commits_url":"https://api.github.com/repos/apotonick/reform/commits{/sha}","git_commits_url":"https://api.github.com/repos/apotonick/reform/git/commits{/sha}","comments_url":"https://api.github.com/repos/apotonick/reform/comments{/number}","issue_comment_url":"https://api.github.com/repos/apotonick/reform/issues/comments{/number}","contents_url":"https://api.github.com/repos/apotonick/reform/contents/{+path}","compare_url":"https://api.github.com/repos/apotonick/reform/compare/{base}...{head}","merges_url":"https://api.github.com/repos/apotonick/reform/merges","archive_url":"https://api.github.com/repos/apotonick/reform/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/apotonick/reform/downloads","issues_url":"https://api.github.com/repos/apotonick/reform/issues{/number}","pulls_url":"https://api.github.com/repos/apotonick/reform/pulls{/number}","milestones_url":"https://api.github.com/repos/apotonick/reform/milestones{/number}","notifications_url":"https://api.github.com/repos/apotonick/reform/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/apotonick/reform/labels{/name}","releases_url":"https://api.github.com/repos/apotonick/reform/releases{/id}","deployments_url":"https://api.github.com/repos/apotonick/reform/deployments","created_at":"2013-04-30T05:02:35Z","updated_at":"2016-07-03T23:04:07Z","pushed_at":"2016-07-05T12:19:21Z","git_url":"git://github.com/apotonick/reform.git","ssh_url":"git@github.com:apotonick/reform.git","clone_url":"https://github.com/apotonick/reform.git","svn_url":"https://github.com/apotonick/reform","homepage":"http://www.trailblazer.to/gems/reform","size":1496,"stargazers_count":1866,"watchers_count":1866,"language":"Ruby","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":141,"mirror_url":null,"open_issues_count":59,"forks":141,"open_issues":59,"watchers":1866,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/apotonick/reform/pulls/199"},"html":{"href":"https://github.com/apotonick/reform/pull/199"},"issue":{"href":"https://api.github.com/repos/apotonick/reform/issues/199"},"comments":{"href":"https://api.github.com/repos/apotonick/reform/issues/199/comments"},"review_comments":{"href":"https://api.github.com/repos/apotonick/reform/pulls/199/comments"},"review_comment":{"href":"https://api.github.com/repos/apotonick/reform/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/apotonick/reform/pulls/199/commits"},"statuses":{"href":"https://api.github.com/repos/apotonick/reform/statuses/427940c7d1f43b82f68acbb3b71d1802fb220874"}},"merged":false,"mergeable":false,"mergeable_state":"dirty","merged_by":null,"comments":1,"review_comments":0,"commits":2,"additions":23,"deletions":3,"changed_files":3}}
{"actor":{"display_login":"fran-worley"}}