{"action":"created","comment":{"url":"https://api.github.com/repos/theforeman/foreman/pulls/comments/34695064","id":34695064,"diff_hunk":"@@ -0,0 +1,17 @@\n+class AddUniqueToOperatingsystemsTitle < ActiveRecord::Migration\n+  def up\n+    duplicities = Operatingsystem.all.group_by(&:title).values.keep_if { |ary| ary.length > 1}\n+    duplicities.each do |systems|\n+      systems.each do |os|\n+        os.description = os.fullname","path":"db/migrate/20150713143226_add_unique_to_operatingsystems_title.rb","position":6,"original_position":6,"commit_id":"6237ebdb17c6482860131b6e53f98a2f589f9bec","original_commit_id":"6237ebdb17c6482860131b6e53f98a2f589f9bec","user":{"login":"eLobato","id":598891,"avatar_url":"https://avatars.githubusercontent.com/u/598891?v=3","gravatar_id":"","url":"https://api.github.com/users/eLobato","html_url":"https://github.com/eLobato","followers_url":"https://api.github.com/users/eLobato/followers","following_url":"https://api.github.com/users/eLobato/following{/other_user}","gists_url":"https://api.github.com/users/eLobato/gists{/gist_id}","starred_url":"https://api.github.com/users/eLobato/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/eLobato/subscriptions","organizations_url":"https://api.github.com/users/eLobato/orgs","repos_url":"https://api.github.com/users/eLobato/repos","events_url":"https://api.github.com/users/eLobato/events{/privacy}","received_events_url":"https://api.github.com/users/eLobato/received_events","type":"User","site_admin":false},"body":"This could inadvertently override `os.description`, what is this double loop supposed to accomplish?","created_at":"2015-07-15T16:02:25Z","updated_at":"2015-07-15T16:02:25Z","html_url":"https://github.com/theforeman/foreman/pull/2543#discussion_r34695064","pull_request_url":"https://api.github.com/repos/theforeman/foreman/pulls/2543","_links":{"self":{"href":"https://api.github.com/repos/theforeman/foreman/pulls/comments/34695064"},"html":{"href":"https://github.com/theforeman/foreman/pull/2543#discussion_r34695064"},"pull_request":{"href":"https://api.github.com/repos/theforeman/foreman/pulls/2543"}}},"pull_request":{"url":"https://api.github.com/repos/theforeman/foreman/pulls/2543","id":39992569,"html_url":"https://github.com/theforeman/foreman/pull/2543","diff_url":"https://github.com/theforeman/foreman/pull/2543.diff","patch_url":"https://github.com/theforeman/foreman/pull/2543.patch","issue_url":"https://api.github.com/repos/theforeman/foreman/issues/2543","number":2543,"state":"open","locked":false,"title":"Fixes #10826 - Adds unique constraint to the title in operatingsystem…","user":{"login":"xprazak2","id":2664090,"avatar_url":"https://avatars.githubusercontent.com/u/2664090?v=3","gravatar_id":"","url":"https://api.github.com/users/xprazak2","html_url":"https://github.com/xprazak2","followers_url":"https://api.github.com/users/xprazak2/followers","following_url":"https://api.github.com/users/xprazak2/following{/other_user}","gists_url":"https://api.github.com/users/xprazak2/gists{/gist_id}","starred_url":"https://api.github.com/users/xprazak2/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/xprazak2/subscriptions","organizations_url":"https://api.github.com/users/xprazak2/orgs","repos_url":"https://api.github.com/users/xprazak2/repos","events_url":"https://api.github.com/users/xprazak2/events{/privacy}","received_events_url":"https://api.github.com/users/xprazak2/received_events","type":"User","site_admin":false},"body":"… table\r\n\r\n\r\nIt also generates a new description for systems with duplicate title based on fullname since description is set as a title in before_validation. This assumes constraints on name and version are not violated.","created_at":"2015-07-15T06:47:06Z","updated_at":"2015-07-15T16:02:25Z","closed_at":null,"merged_at":null,"merge_commit_sha":"18f85e97733663bb6960c3b4bd784ed535bd46dd","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/theforeman/foreman/pulls/2543/commits","review_comments_url":"https://api.github.com/repos/theforeman/foreman/pulls/2543/comments","review_comment_url":"https://api.github.com/repos/theforeman/foreman/pulls/comments{/number}","comments_url":"https://api.github.com/repos/theforeman/foreman/issues/2543/comments","statuses_url":"https://api.github.com/repos/theforeman/foreman/statuses/6237ebdb17c6482860131b6e53f98a2f589f9bec","head":{"label":"xprazak2:os-title","ref":"os-title","sha":"6237ebdb17c6482860131b6e53f98a2f589f9bec","user":{"login":"xprazak2","id":2664090,"avatar_url":"https://avatars.githubusercontent.com/u/2664090?v=3","gravatar_id":"","url":"https://api.github.com/users/xprazak2","html_url":"https://github.com/xprazak2","followers_url":"https://api.github.com/users/xprazak2/followers","following_url":"https://api.github.com/users/xprazak2/following{/other_user}","gists_url":"https://api.github.com/users/xprazak2/gists{/gist_id}","starred_url":"https://api.github.com/users/xprazak2/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/xprazak2/subscriptions","organizations_url":"https://api.github.com/users/xprazak2/orgs","repos_url":"https://api.github.com/users/xprazak2/repos","events_url":"https://api.github.com/users/xprazak2/events{/privacy}","received_events_url":"https://api.github.com/users/xprazak2/received_events","type":"User","site_admin":false},"repo":{"id":33602529,"name":"foreman","full_name":"xprazak2/foreman","owner":{"login":"xprazak2","id":2664090,"avatar_url":"https://avatars.githubusercontent.com/u/2664090?v=3","gravatar_id":"","url":"https://api.github.com/users/xprazak2","html_url":"https://github.com/xprazak2","followers_url":"https://api.github.com/users/xprazak2/followers","following_url":"https://api.github.com/users/xprazak2/following{/other_user}","gists_url":"https://api.github.com/users/xprazak2/gists{/gist_id}","starred_url":"https://api.github.com/users/xprazak2/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/xprazak2/subscriptions","organizations_url":"https://api.github.com/users/xprazak2/orgs","repos_url":"https://api.github.com/users/xprazak2/repos","events_url":"https://api.github.com/users/xprazak2/events{/privacy}","received_events_url":"https://api.github.com/users/xprazak2/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/xprazak2/foreman","description":"an application that automates the lifecycle of servers ","fork":true,"url":"https://api.github.com/repos/xprazak2/foreman","forks_url":"https://api.github.com/repos/xprazak2/foreman/forks","keys_url":"https://api.github.com/repos/xprazak2/foreman/keys{/key_id}","collaborators_url":"https://api.github.com/repos/xprazak2/foreman/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/xprazak2/foreman/teams","hooks_url":"https://api.github.com/repos/xprazak2/foreman/hooks","issue_events_url":"https://api.github.com/repos/xprazak2/foreman/issues/events{/number}","events_url":"https://api.github.com/repos/xprazak2/foreman/events","assignees_url":"https://api.github.com/repos/xprazak2/foreman/assignees{/user}","branches_url":"https://api.github.com/repos/xprazak2/foreman/branches{/branch}","tags_url":"https://api.github.com/repos/xprazak2/foreman/tags","blobs_url":"https://api.github.com/repos/xprazak2/foreman/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/xprazak2/foreman/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/xprazak2/foreman/git/refs{/sha}","trees_url":"https://api.github.com/repos/xprazak2/foreman/git/trees{/sha}","statuses_url":"https://api.github.com/repos/xprazak2/foreman/statuses/{sha}","languages_url":"https://api.github.com/repos/xprazak2/foreman/languages","stargazers_url":"https://api.github.com/repos/xprazak2/foreman/stargazers","contributors_url":"https://api.github.com/repos/xprazak2/foreman/contributors","subscribers_url":"https://api.github.com/repos/xprazak2/foreman/subscribers","subscription_url":"https://api.github.com/repos/xprazak2/foreman/subscription","commits_url":"https://api.github.com/repos/xprazak2/foreman/commits{/sha}","git_commits_url":"https://api.github.com/repos/xprazak2/foreman/git/commits{/sha}","comments_url":"https://api.github.com/repos/xprazak2/foreman/comments{/number}","issue_comment_url":"https://api.github.com/repos/xprazak2/foreman/issues/comments{/number}","contents_url":"https://api.github.com/repos/xprazak2/foreman/contents/{+path}","compare_url":"https://api.github.com/repos/xprazak2/foreman/compare/{base}...{head}","merges_url":"https://api.github.com/repos/xprazak2/foreman/merges","archive_url":"https://api.github.com/repos/xprazak2/foreman/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/xprazak2/foreman/downloads","issues_url":"https://api.github.com/repos/xprazak2/foreman/issues{/number}","pulls_url":"https://api.github.com/repos/xprazak2/foreman/pulls{/number}","milestones_url":"https://api.github.com/repos/xprazak2/foreman/milestones{/number}","notifications_url":"https://api.github.com/repos/xprazak2/foreman/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/xprazak2/foreman/labels{/name}","releases_url":"https://api.github.com/repos/xprazak2/foreman/releases{/id}","created_at":"2015-04-08T11:23:52Z","updated_at":"2015-04-08T11:23:58Z","pushed_at":"2015-07-15T12:40:30Z","git_url":"git://github.com/xprazak2/foreman.git","ssh_url":"git@github.com:xprazak2/foreman.git","clone_url":"https://github.com/xprazak2/foreman.git","svn_url":"https://github.com/xprazak2/foreman","homepage":"http://theforeman.org","size":34202,"stargazers_count":0,"watchers_count":0,"language":"Ruby","has_issues":false,"has_downloads":false,"has_wiki":false,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"develop"}},"base":{"label":"theforeman:develop","ref":"develop","sha":"9d8251094866fe2002ffcb8f94c7963bc01ca561","user":{"login":"theforeman","id":1439844,"avatar_url":"https://avatars.githubusercontent.com/u/1439844?v=3","gravatar_id":"","url":"https://api.github.com/users/theforeman","html_url":"https://github.com/theforeman","followers_url":"https://api.github.com/users/theforeman/followers","following_url":"https://api.github.com/users/theforeman/following{/other_user}","gists_url":"https://api.github.com/users/theforeman/gists{/gist_id}","starred_url":"https://api.github.com/users/theforeman/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/theforeman/subscriptions","organizations_url":"https://api.github.com/users/theforeman/orgs","repos_url":"https://api.github.com/users/theforeman/repos","events_url":"https://api.github.com/users/theforeman/events{/privacy}","received_events_url":"https://api.github.com/users/theforeman/received_events","type":"Organization","site_admin":false},"repo":{"id":258750,"name":"foreman","full_name":"theforeman/foreman","owner":{"login":"theforeman","id":1439844,"avatar_url":"https://avatars.githubusercontent.com/u/1439844?v=3","gravatar_id":"","url":"https://api.github.com/users/theforeman","html_url":"https://github.com/theforeman","followers_url":"https://api.github.com/users/theforeman/followers","following_url":"https://api.github.com/users/theforeman/following{/other_user}","gists_url":"https://api.github.com/users/theforeman/gists{/gist_id}","starred_url":"https://api.github.com/users/theforeman/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/theforeman/subscriptions","organizations_url":"https://api.github.com/users/theforeman/orgs","repos_url":"https://api.github.com/users/theforeman/repos","events_url":"https://api.github.com/users/theforeman/events{/privacy}","received_events_url":"https://api.github.com/users/theforeman/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/theforeman/foreman","description":"an application that automates the lifecycle of servers ","fork":false,"url":"https://api.github.com/repos/theforeman/foreman","forks_url":"https://api.github.com/repos/theforeman/foreman/forks","keys_url":"https://api.github.com/repos/theforeman/foreman/keys{/key_id}","collaborators_url":"https://api.github.com/repos/theforeman/foreman/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/theforeman/foreman/teams","hooks_url":"https://api.github.com/repos/theforeman/foreman/hooks","issue_events_url":"https://api.github.com/repos/theforeman/foreman/issues/events{/number}","events_url":"https://api.github.com/repos/theforeman/foreman/events","assignees_url":"https://api.github.com/repos/theforeman/foreman/assignees{/user}","branches_url":"https://api.github.com/repos/theforeman/foreman/branches{/branch}","tags_url":"https://api.github.com/repos/theforeman/foreman/tags","blobs_url":"https://api.github.com/repos/theforeman/foreman/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/theforeman/foreman/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/theforeman/foreman/git/refs{/sha}","trees_url":"https://api.github.com/repos/theforeman/foreman/git/trees{/sha}","statuses_url":"https://api.github.com/repos/theforeman/foreman/statuses/{sha}","languages_url":"https://api.github.com/repos/theforeman/foreman/languages","stargazers_url":"https://api.github.com/repos/theforeman/foreman/stargazers","contributors_url":"https://api.github.com/repos/theforeman/foreman/contributors","subscribers_url":"https://api.github.com/repos/theforeman/foreman/subscribers","subscription_url":"https://api.github.com/repos/theforeman/foreman/subscription","commits_url":"https://api.github.com/repos/theforeman/foreman/commits{/sha}","git_commits_url":"https://api.github.com/repos/theforeman/foreman/git/commits{/sha}","comments_url":"https://api.github.com/repos/theforeman/foreman/comments{/number}","issue_comment_url":"https://api.github.com/repos/theforeman/foreman/issues/comments{/number}","contents_url":"https://api.github.com/repos/theforeman/foreman/contents/{+path}","compare_url":"https://api.github.com/repos/theforeman/foreman/compare/{base}...{head}","merges_url":"https://api.github.com/repos/theforeman/foreman/merges","archive_url":"https://api.github.com/repos/theforeman/foreman/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/theforeman/foreman/downloads","issues_url":"https://api.github.com/repos/theforeman/foreman/issues{/number}","pulls_url":"https://api.github.com/repos/theforeman/foreman/pulls{/number}","milestones_url":"https://api.github.com/repos/theforeman/foreman/milestones{/number}","notifications_url":"https://api.github.com/repos/theforeman/foreman/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/theforeman/foreman/labels{/name}","releases_url":"https://api.github.com/repos/theforeman/foreman/releases{/id}","created_at":"2009-07-23T15:07:00Z","updated_at":"2015-07-13T18:38:44Z","pushed_at":"2015-07-15T14:39:29Z","git_url":"git://github.com/theforeman/foreman.git","ssh_url":"git@github.com:theforeman/foreman.git","clone_url":"https://github.com/theforeman/foreman.git","svn_url":"https://github.com/theforeman/foreman","homepage":"http://theforeman.org","size":83608,"stargazers_count":803,"watchers_count":803,"language":"Ruby","has_issues":false,"has_downloads":false,"has_wiki":false,"has_pages":false,"forks_count":409,"mirror_url":null,"open_issues_count":88,"forks":409,"open_issues":88,"watchers":803,"default_branch":"develop"}},"_links":{"self":{"href":"https://api.github.com/repos/theforeman/foreman/pulls/2543"},"html":{"href":"https://github.com/theforeman/foreman/pull/2543"},"issue":{"href":"https://api.github.com/repos/theforeman/foreman/issues/2543"},"comments":{"href":"https://api.github.com/repos/theforeman/foreman/issues/2543/comments"},"review_comments":{"href":"https://api.github.com/repos/theforeman/foreman/pulls/2543/comments"},"review_comment":{"href":"https://api.github.com/repos/theforeman/foreman/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/theforeman/foreman/pulls/2543/commits"},"statuses":{"href":"https://api.github.com/repos/theforeman/foreman/statuses/6237ebdb17c6482860131b6e53f98a2f589f9bec"}}}}