{"action":"created","comment":{"url":"https://api.github.com/repos/activeadmin/activeadmin/pulls/comments/33396416","id":33396416,"diff_hunk":"@@ -277,6 +277,69 @@ def build_form(options = {}, form_object = Post.new, &block)\n \n   end\n \n+\n+  context \"with a button to add a new has_one relationship\" do \n+    let :body do\n+      build_form do |f|\n+        f.inputs do\n+          f.input :title\n+          f.input :body\n+        end\n+        f.form_builder.instance_eval do\n+          @object.author = User.new\n+        end\n+        f.inputs name: 'Author', for: :author do |author|\n+          author.inputs :first_name, :last_name\n+          author.has_many :profile, allow_destroy: true do |profile|\n+            profile.input :bio\n+          end\n+        end\n+      end\n+    end\n+\n+    it \"should see a button to add the has_one relation\" do \n+      expect(body).to have_selector(\"a[contains(data-html,'post[author_attributes][profile_attributes][bio]')]\")\n+    end\n+\n+  end\n+\n+  context \"with a has_one relation on an author's profile\" do \n+    let :body do \n+      author = user()\n+      build_form do |f|\n+        f.inputs do\n+          f.input :title\n+          f.input :body\n+        end\n+        f.form_builder.instance_eval do\n+          @object.author = author \n+        end\n+        f.inputs name: 'Author', for: :author do |author|\n+          author.has_many :profile, allow_destroy: true do |profile|\n+            profile.input :bio\n+          end\n+        end\n+      end\n+    end\n+\n+    it \"should see the button to add profile\" do \n+      def user\n+        User.new\n+      end\n+      expect(body).to have_selector(\"a[contains(data-html,'post[author_attributes][profile_attributes][bio]')]\")\n+    end\n+\n+    it \"should see the profile fields for an existing profile\" do ","path":"spec/unit/form_builder_spec.rb","position":56,"original_position":56,"commit_id":"5d7eee13691ae34ce115944b2fef0b1b5b8dfa44","original_commit_id":"5d7eee13691ae34ce115944b2fef0b1b5b8dfa44","user":{"login":"houndci","id":6697940,"avatar_url":"https://avatars.githubusercontent.com/u/6697940?v=3","gravatar_id":"","url":"https://api.github.com/users/houndci","html_url":"https://github.com/houndci","followers_url":"https://api.github.com/users/houndci/followers","following_url":"https://api.github.com/users/houndci/following{/other_user}","gists_url":"https://api.github.com/users/houndci/gists{/gist_id}","starred_url":"https://api.github.com/users/houndci/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/houndci/subscriptions","organizations_url":"https://api.github.com/users/houndci/orgs","repos_url":"https://api.github.com/users/houndci/repos","events_url":"https://api.github.com/users/houndci/events{/privacy}","received_events_url":"https://api.github.com/users/houndci/received_events","type":"User","site_admin":false},"body":"Trailing whitespace detected.","created_at":"2015-06-26T21:12:01Z","updated_at":"2015-06-26T21:12:01Z","html_url":"https://github.com/activeadmin/activeadmin/pull/4010#discussion_r33396416","pull_request_url":"https://api.github.com/repos/activeadmin/activeadmin/pulls/4010","_links":{"self":{"href":"https://api.github.com/repos/activeadmin/activeadmin/pulls/comments/33396416"},"html":{"href":"https://github.com/activeadmin/activeadmin/pull/4010#discussion_r33396416"},"pull_request":{"href":"https://api.github.com/repos/activeadmin/activeadmin/pulls/4010"}}},"pull_request":{"url":"https://api.github.com/repos/activeadmin/activeadmin/pulls/4010","id":38689764,"html_url":"https://github.com/activeadmin/activeadmin/pull/4010","diff_url":"https://github.com/activeadmin/activeadmin/pull/4010.diff","patch_url":"https://github.com/activeadmin/activeadmin/pull/4010.patch","issue_url":"https://api.github.com/repos/activeadmin/activeadmin/issues/4010","number":4010,"state":"open","locked":false,"title":"3978: Fix the concat error on has_one relations","user":{"login":"buermann","id":377180,"avatar_url":"https://avatars.githubusercontent.com/u/377180?v=3","gravatar_id":"","url":"https://api.github.com/users/buermann","html_url":"https://github.com/buermann","followers_url":"https://api.github.com/users/buermann/followers","following_url":"https://api.github.com/users/buermann/following{/other_user}","gists_url":"https://api.github.com/users/buermann/gists{/gist_id}","starred_url":"https://api.github.com/users/buermann/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/buermann/subscriptions","organizations_url":"https://api.github.com/users/buermann/orgs","repos_url":"https://api.github.com/users/buermann/repos","events_url":"https://api.github.com/users/buermann/events{/privacy}","received_events_url":"https://api.github.com/users/buermann/received_events","type":"User","site_admin":false},"body":"3978: When generating the nested attributes for an undefined has_one\r\n    relationship form builder blows up with \"undefined method '<<' for\r\n    nil:NilClass\" because the content has been initialized as nil.\r\n    Defensively setting content to an empty html_safe string resolves the\r\n    issue.\r\n\r\nAdded rudimentary test coverage for a has_one relationship.","created_at":"2015-06-26T21:10:26Z","updated_at":"2015-06-26T21:12:01Z","closed_at":null,"merged_at":null,"merge_commit_sha":"d8a9c7a64df681c881c480683be4d01c255d60a1","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/activeadmin/activeadmin/pulls/4010/commits","review_comments_url":"https://api.github.com/repos/activeadmin/activeadmin/pulls/4010/comments","review_comment_url":"https://api.github.com/repos/activeadmin/activeadmin/pulls/comments{/number}","comments_url":"https://api.github.com/repos/activeadmin/activeadmin/issues/4010/comments","statuses_url":"https://api.github.com/repos/activeadmin/activeadmin/statuses/5d7eee13691ae34ce115944b2fef0b1b5b8dfa44","head":{"label":"buermann:3978-nested-has-one-concat-error","ref":"3978-nested-has-one-concat-error","sha":"5d7eee13691ae34ce115944b2fef0b1b5b8dfa44","user":{"login":"buermann","id":377180,"avatar_url":"https://avatars.githubusercontent.com/u/377180?v=3","gravatar_id":"","url":"https://api.github.com/users/buermann","html_url":"https://github.com/buermann","followers_url":"https://api.github.com/users/buermann/followers","following_url":"https://api.github.com/users/buermann/following{/other_user}","gists_url":"https://api.github.com/users/buermann/gists{/gist_id}","starred_url":"https://api.github.com/users/buermann/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/buermann/subscriptions","organizations_url":"https://api.github.com/users/buermann/orgs","repos_url":"https://api.github.com/users/buermann/repos","events_url":"https://api.github.com/users/buermann/events{/privacy}","received_events_url":"https://api.github.com/users/buermann/received_events","type":"User","site_admin":false},"repo":{"id":38133269,"name":"activeadmin","full_name":"buermann/activeadmin","owner":{"login":"buermann","id":377180,"avatar_url":"https://avatars.githubusercontent.com/u/377180?v=3","gravatar_id":"","url":"https://api.github.com/users/buermann","html_url":"https://github.com/buermann","followers_url":"https://api.github.com/users/buermann/followers","following_url":"https://api.github.com/users/buermann/following{/other_user}","gists_url":"https://api.github.com/users/buermann/gists{/gist_id}","starred_url":"https://api.github.com/users/buermann/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/buermann/subscriptions","organizations_url":"https://api.github.com/users/buermann/orgs","repos_url":"https://api.github.com/users/buermann/repos","events_url":"https://api.github.com/users/buermann/events{/privacy}","received_events_url":"https://api.github.com/users/buermann/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/buermann/activeadmin","description":"The administration framework for Ruby on Rails applications.","fork":true,"url":"https://api.github.com/repos/buermann/activeadmin","forks_url":"https://api.github.com/repos/buermann/activeadmin/forks","keys_url":"https://api.github.com/repos/buermann/activeadmin/keys{/key_id}","collaborators_url":"https://api.github.com/repos/buermann/activeadmin/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/buermann/activeadmin/teams","hooks_url":"https://api.github.com/repos/buermann/activeadmin/hooks","issue_events_url":"https://api.github.com/repos/buermann/activeadmin/issues/events{/number}","events_url":"https://api.github.com/repos/buermann/activeadmin/events","assignees_url":"https://api.github.com/repos/buermann/activeadmin/assignees{/user}","branches_url":"https://api.github.com/repos/buermann/activeadmin/branches{/branch}","tags_url":"https://api.github.com/repos/buermann/activeadmin/tags","blobs_url":"https://api.github.com/repos/buermann/activeadmin/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/buermann/activeadmin/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/buermann/activeadmin/git/refs{/sha}","trees_url":"https://api.github.com/repos/buermann/activeadmin/git/trees{/sha}","statuses_url":"https://api.github.com/repos/buermann/activeadmin/statuses/{sha}","languages_url":"https://api.github.com/repos/buermann/activeadmin/languages","stargazers_url":"https://api.github.com/repos/buermann/activeadmin/stargazers","contributors_url":"https://api.github.com/repos/buermann/activeadmin/contributors","subscribers_url":"https://api.github.com/repos/buermann/activeadmin/subscribers","subscription_url":"https://api.github.com/repos/buermann/activeadmin/subscription","commits_url":"https://api.github.com/repos/buermann/activeadmin/commits{/sha}","git_commits_url":"https://api.github.com/repos/buermann/activeadmin/git/commits{/sha}","comments_url":"https://api.github.com/repos/buermann/activeadmin/comments{/number}","issue_comment_url":"https://api.github.com/repos/buermann/activeadmin/issues/comments{/number}","contents_url":"https://api.github.com/repos/buermann/activeadmin/contents/{+path}","compare_url":"https://api.github.com/repos/buermann/activeadmin/compare/{base}...{head}","merges_url":"https://api.github.com/repos/buermann/activeadmin/merges","archive_url":"https://api.github.com/repos/buermann/activeadmin/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/buermann/activeadmin/downloads","issues_url":"https://api.github.com/repos/buermann/activeadmin/issues{/number}","pulls_url":"https://api.github.com/repos/buermann/activeadmin/pulls{/number}","milestones_url":"https://api.github.com/repos/buermann/activeadmin/milestones{/number}","notifications_url":"https://api.github.com/repos/buermann/activeadmin/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/buermann/activeadmin/labels{/name}","releases_url":"https://api.github.com/repos/buermann/activeadmin/releases{/id}","created_at":"2015-06-26T20:55:32Z","updated_at":"2015-06-26T20:55:35Z","pushed_at":"2015-06-26T21:08:51Z","git_url":"git://github.com/buermann/activeadmin.git","ssh_url":"git@github.com:buermann/activeadmin.git","clone_url":"https://github.com/buermann/activeadmin.git","svn_url":"https://github.com/buermann/activeadmin","homepage":"activeadmin.info","size":18638,"stargazers_count":0,"watchers_count":0,"language":"Ruby","has_issues":false,"has_downloads":false,"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":"activeadmin:master","ref":"master","sha":"655e2be7a351411d3b52b5fa26555a74829d736e","user":{"login":"activeadmin","id":814570,"avatar_url":"https://avatars.githubusercontent.com/u/814570?v=3","gravatar_id":"","url":"https://api.github.com/users/activeadmin","html_url":"https://github.com/activeadmin","followers_url":"https://api.github.com/users/activeadmin/followers","following_url":"https://api.github.com/users/activeadmin/following{/other_user}","gists_url":"https://api.github.com/users/activeadmin/gists{/gist_id}","starred_url":"https://api.github.com/users/activeadmin/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/activeadmin/subscriptions","organizations_url":"https://api.github.com/users/activeadmin/orgs","repos_url":"https://api.github.com/users/activeadmin/repos","events_url":"https://api.github.com/users/activeadmin/events{/privacy}","received_events_url":"https://api.github.com/users/activeadmin/received_events","type":"Organization","site_admin":false},"repo":{"id":611921,"name":"activeadmin","full_name":"activeadmin/activeadmin","owner":{"login":"activeadmin","id":814570,"avatar_url":"https://avatars.githubusercontent.com/u/814570?v=3","gravatar_id":"","url":"https://api.github.com/users/activeadmin","html_url":"https://github.com/activeadmin","followers_url":"https://api.github.com/users/activeadmin/followers","following_url":"https://api.github.com/users/activeadmin/following{/other_user}","gists_url":"https://api.github.com/users/activeadmin/gists{/gist_id}","starred_url":"https://api.github.com/users/activeadmin/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/activeadmin/subscriptions","organizations_url":"https://api.github.com/users/activeadmin/orgs","repos_url":"https://api.github.com/users/activeadmin/repos","events_url":"https://api.github.com/users/activeadmin/events{/privacy}","received_events_url":"https://api.github.com/users/activeadmin/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/activeadmin/activeadmin","description":"The administration framework for Ruby on Rails applications.","fork":false,"url":"https://api.github.com/repos/activeadmin/activeadmin","forks_url":"https://api.github.com/repos/activeadmin/activeadmin/forks","keys_url":"https://api.github.com/repos/activeadmin/activeadmin/keys{/key_id}","collaborators_url":"https://api.github.com/repos/activeadmin/activeadmin/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/activeadmin/activeadmin/teams","hooks_url":"https://api.github.com/repos/activeadmin/activeadmin/hooks","issue_events_url":"https://api.github.com/repos/activeadmin/activeadmin/issues/events{/number}","events_url":"https://api.github.com/repos/activeadmin/activeadmin/events","assignees_url":"https://api.github.com/repos/activeadmin/activeadmin/assignees{/user}","branches_url":"https://api.github.com/repos/activeadmin/activeadmin/branches{/branch}","tags_url":"https://api.github.com/repos/activeadmin/activeadmin/tags","blobs_url":"https://api.github.com/repos/activeadmin/activeadmin/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/activeadmin/activeadmin/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/activeadmin/activeadmin/git/refs{/sha}","trees_url":"https://api.github.com/repos/activeadmin/activeadmin/git/trees{/sha}","statuses_url":"https://api.github.com/repos/activeadmin/activeadmin/statuses/{sha}","languages_url":"https://api.github.com/repos/activeadmin/activeadmin/languages","stargazers_url":"https://api.github.com/repos/activeadmin/activeadmin/stargazers","contributors_url":"https://api.github.com/repos/activeadmin/activeadmin/contributors","subscribers_url":"https://api.github.com/repos/activeadmin/activeadmin/subscribers","subscription_url":"https://api.github.com/repos/activeadmin/activeadmin/subscription","commits_url":"https://api.github.com/repos/activeadmin/activeadmin/commits{/sha}","git_commits_url":"https://api.github.com/repos/activeadmin/activeadmin/git/commits{/sha}","comments_url":"https://api.github.com/repos/activeadmin/activeadmin/comments{/number}","issue_comment_url":"https://api.github.com/repos/activeadmin/activeadmin/issues/comments{/number}","contents_url":"https://api.github.com/repos/activeadmin/activeadmin/contents/{+path}","compare_url":"https://api.github.com/repos/activeadmin/activeadmin/compare/{base}...{head}","merges_url":"https://api.github.com/repos/activeadmin/activeadmin/merges","archive_url":"https://api.github.com/repos/activeadmin/activeadmin/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/activeadmin/activeadmin/downloads","issues_url":"https://api.github.com/repos/activeadmin/activeadmin/issues{/number}","pulls_url":"https://api.github.com/repos/activeadmin/activeadmin/pulls{/number}","milestones_url":"https://api.github.com/repos/activeadmin/activeadmin/milestones{/number}","notifications_url":"https://api.github.com/repos/activeadmin/activeadmin/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/activeadmin/activeadmin/labels{/name}","releases_url":"https://api.github.com/repos/activeadmin/activeadmin/releases{/id}","created_at":"2010-04-15T14:26:03Z","updated_at":"2015-06-26T14:51:55Z","pushed_at":"2015-06-26T21:10:26Z","git_url":"git://github.com/activeadmin/activeadmin.git","ssh_url":"git@github.com:activeadmin/activeadmin.git","clone_url":"https://github.com/activeadmin/activeadmin.git","svn_url":"https://github.com/activeadmin/activeadmin","homepage":"activeadmin.info","size":18638,"stargazers_count":6025,"watchers_count":6025,"language":"Ruby","has_issues":true,"has_downloads":false,"has_wiki":true,"has_pages":false,"forks_count":2138,"mirror_url":null,"open_issues_count":216,"forks":2138,"open_issues":216,"watchers":6025,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/activeadmin/activeadmin/pulls/4010"},"html":{"href":"https://github.com/activeadmin/activeadmin/pull/4010"},"issue":{"href":"https://api.github.com/repos/activeadmin/activeadmin/issues/4010"},"comments":{"href":"https://api.github.com/repos/activeadmin/activeadmin/issues/4010/comments"},"review_comments":{"href":"https://api.github.com/repos/activeadmin/activeadmin/pulls/4010/comments"},"review_comment":{"href":"https://api.github.com/repos/activeadmin/activeadmin/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/activeadmin/activeadmin/pulls/4010/commits"},"statuses":{"href":"https://api.github.com/repos/activeadmin/activeadmin/statuses/5d7eee13691ae34ce115944b2fef0b1b5b8dfa44"}}}}