GitHub PullRequestReviewCommentEvent at 2014-06-25 15:33:19
Repository: osem
Actor: hennevogel
Payload: {"action":"created","comment":{"url":"https://api.github.com/repos/openSUSE/osem/pulls/comments/14193321","id":14193321,"diff_hunk":"@@ -0,0 +1,83 @@\n+class Campaign < ActiveRecord::Base\n+  attr_accessible :name, :utm_source, :utm_medium, :utm_term,\n+                  :utm_content, :utm_campaign, :target_ids\n+\n+  validates :name, :utm_campaign, presence: true\n+\n+  has_many :targets\n+  belongs_to :conference\n+\n+  ##\n+  # Returns the utm parameters formatted as url.\n+  #\n+  # ====Returns\n+  # * +String+ -> url parameters e.g. ?utm_source=facebook\n+  def url_parameters\n+    first = true\n+    result = ''","path":"app/models/campaign.rb","position":17,"original_position":17,"commit_id":"f4a269f55eeaed4346f616403cb516c40530f8fd","original_commit_id":"8e5e944d39f551e7da736408c4e49ca0f1f33bab","user":{"login":"hennevogel","id":514785,"avatar_url":"https://avatars.githubusercontent.com/u/514785?","gravatar_id":"9767aae13b5dc5bae57766bd5ad32421","url":"https://api.github.com/users/hennevogel","html_url":"https://github.com/hennevogel","followers_url":"https://api.github.com/users/hennevogel/followers","following_url":"https://api.github.com/users/hennevogel/following{/other_user}","gists_url":"https://api.github.com/users/hennevogel/gists{/gist_id}","starred_url":"https://api.github.com/users/hennevogel/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/hennevogel/subscriptions","organizations_url":"https://api.github.com/users/hennevogel/orgs","repos_url":"https://api.github.com/users/hennevogel/repos","events_url":"https://api.github.com/users/hennevogel/events{/privacy}","received_events_url":"https://api.github.com/users/hennevogel/received_events","type":"User","site_admin":false},"body":"I don't like the 'first'-if. I think you can do this more elegantly with .each_pair for instance: \r\n```ruby\r\nhash = {1 => 'one', 2 => 'two', 3 => 'three'}\r\nkv = []\r\nhash.each_pair do |k,v|\r\n  kv += [\"#{k}=#{v}\"]\r\nend\r\nresult = \"?\" + kv.join('&') unless kv.empty?\r\n```","created_at":"2014-06-25T15:33:19Z","updated_at":"2014-06-25T15:33:19Z","html_url":"https://github.com/openSUSE/osem/pull/266#discussion_r14193321","pull_request_url":"https://api.github.com/repos/openSUSE/osem/pulls/266","_links":{"self":{"href":"https://api.github.com/repos/openSUSE/osem/pulls/comments/14193321"},"html":{"href":"https://github.com/openSUSE/osem/pull/266#discussion_r14193321"},"pull_request":{"href":"https://api.github.com/repos/openSUSE/osem/pulls/266"}}},"pull_request":{"url":"https://api.github.com/repos/openSUSE/osem/pulls/266","id":17544391,"html_url":"https://github.com/openSUSE/osem/pull/266","diff_url":"https://github.com/openSUSE/osem/pull/266.diff","patch_url":"https://github.com/openSUSE/osem/pull/266.patch","issue_url":"https://api.github.com/repos/openSUSE/osem/issues/266","number":266,"state":"open","title":"Implements targets and campaigns for conference","user":{"login":"ChrisBr","id":3799140,"avatar_url":"https://avatars.githubusercontent.com/u/3799140?","gravatar_id":"718574c9143bba1d0427a58749943956","url":"https://api.github.com/users/ChrisBr","html_url":"https://github.com/ChrisBr","followers_url":"https://api.github.com/users/ChrisBr/followers","following_url":"https://api.github.com/users/ChrisBr/following{/other_user}","gists_url":"https://api.github.com/users/ChrisBr/gists{/gist_id}","starred_url":"https://api.github.com/users/ChrisBr/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ChrisBr/subscriptions","organizations_url":"https://api.github.com/users/ChrisBr/orgs","repos_url":"https://api.github.com/users/ChrisBr/repos","events_url":"https://api.github.com/users/ChrisBr/events{/privacy}","received_events_url":"https://api.github.com/users/ChrisBr/received_events","type":"User","site_admin":false},"body":"","created_at":"2014-06-24T17:05:39Z","updated_at":"2014-06-25T15:33:19Z","closed_at":null,"merged_at":null,"merge_commit_sha":"9cb0419b9fc781e606bc65209aaebad6ed930c76","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/openSUSE/osem/pulls/266/commits","review_comments_url":"https://api.github.com/repos/openSUSE/osem/pulls/266/comments","review_comment_url":"https://api.github.com/repos/openSUSE/osem/pulls/comments/{number}","comments_url":"https://api.github.com/repos/openSUSE/osem/issues/266/comments","statuses_url":"https://api.github.com/repos/openSUSE/osem/statuses/f4a269f55eeaed4346f616403cb516c40530f8fd","head":{"label":"ChrisBr:implements_ahoy","ref":"implements_ahoy","sha":"f4a269f55eeaed4346f616403cb516c40530f8fd","user":{"login":"ChrisBr","id":3799140,"avatar_url":"https://avatars.githubusercontent.com/u/3799140?","gravatar_id":"718574c9143bba1d0427a58749943956","url":"https://api.github.com/users/ChrisBr","html_url":"https://github.com/ChrisBr","followers_url":"https://api.github.com/users/ChrisBr/followers","following_url":"https://api.github.com/users/ChrisBr/following{/other_user}","gists_url":"https://api.github.com/users/ChrisBr/gists{/gist_id}","starred_url":"https://api.github.com/users/ChrisBr/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ChrisBr/subscriptions","organizations_url":"https://api.github.com/users/ChrisBr/orgs","repos_url":"https://api.github.com/users/ChrisBr/repos","events_url":"https://api.github.com/users/ChrisBr/events{/privacy}","received_events_url":"https://api.github.com/users/ChrisBr/received_events","type":"User","site_admin":false},"repo":{"id":17600815,"name":"osem","full_name":"ChrisBr/osem","owner":{"login":"ChrisBr","id":3799140,"avatar_url":"https://avatars.githubusercontent.com/u/3799140?","gravatar_id":"718574c9143bba1d0427a58749943956","url":"https://api.github.com/users/ChrisBr","html_url":"https://github.com/ChrisBr","followers_url":"https://api.github.com/users/ChrisBr/followers","following_url":"https://api.github.com/users/ChrisBr/following{/other_user}","gists_url":"https://api.github.com/users/ChrisBr/gists{/gist_id}","starred_url":"https://api.github.com/users/ChrisBr/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ChrisBr/subscriptions","organizations_url":"https://api.github.com/users/ChrisBr/orgs","repos_url":"https://api.github.com/users/ChrisBr/repos","events_url":"https://api.github.com/users/ChrisBr/events{/privacy}","received_events_url":"https://api.github.com/users/ChrisBr/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/ChrisBr/osem","description":"Open Source Event Manager","fork":true,"url":"https://api.github.com/repos/ChrisBr/osem","forks_url":"https://api.github.com/repos/ChrisBr/osem/forks","keys_url":"https://api.github.com/repos/ChrisBr/osem/keys{/key_id}","collaborators_url":"https://api.github.com/repos/ChrisBr/osem/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/ChrisBr/osem/teams","hooks_url":"https://api.github.com/repos/ChrisBr/osem/hooks","issue_events_url":"https://api.github.com/repos/ChrisBr/osem/issues/events{/number}","events_url":"https://api.github.com/repos/ChrisBr/osem/events","assignees_url":"https://api.github.com/repos/ChrisBr/osem/assignees{/user}","branches_url":"https://api.github.com/repos/ChrisBr/osem/branches{/branch}","tags_url":"https://api.github.com/repos/ChrisBr/osem/tags","blobs_url":"https://api.github.com/repos/ChrisBr/osem/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/ChrisBr/osem/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/ChrisBr/osem/git/refs{/sha}","trees_url":"https://api.github.com/repos/ChrisBr/osem/git/trees{/sha}","statuses_url":"https://api.github.com/repos/ChrisBr/osem/statuses/{sha}","languages_url":"https://api.github.com/repos/ChrisBr/osem/languages","stargazers_url":"https://api.github.com/repos/ChrisBr/osem/stargazers","contributors_url":"https://api.github.com/repos/ChrisBr/osem/contributors","subscribers_url":"https://api.github.com/repos/ChrisBr/osem/subscribers","subscription_url":"https://api.github.com/repos/ChrisBr/osem/subscription","commits_url":"https://api.github.com/repos/ChrisBr/osem/commits{/sha}","git_commits_url":"https://api.github.com/repos/ChrisBr/osem/git/commits{/sha}","comments_url":"https://api.github.com/repos/ChrisBr/osem/comments{/number}","issue_comment_url":"https://api.github.com/repos/ChrisBr/osem/issues/comments/{number}","contents_url":"https://api.github.com/repos/ChrisBr/osem/contents/{+path}","compare_url":"https://api.github.com/repos/ChrisBr/osem/compare/{base}...{head}","merges_url":"https://api.github.com/repos/ChrisBr/osem/merges","archive_url":"https://api.github.com/repos/ChrisBr/osem/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/ChrisBr/osem/downloads","issues_url":"https://api.github.com/repos/ChrisBr/osem/issues{/number}","pulls_url":"https://api.github.com/repos/ChrisBr/osem/pulls{/number}","milestones_url":"https://api.github.com/repos/ChrisBr/osem/milestones{/number}","notifications_url":"https://api.github.com/repos/ChrisBr/osem/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/ChrisBr/osem/labels{/name}","releases_url":"https://api.github.com/repos/ChrisBr/osem/releases{/id}","created_at":"2014-03-10T17:04:49Z","updated_at":"2014-06-25T06:32:40Z","pushed_at":"2014-06-25T14:45:26Z","git_url":"git://github.com/ChrisBr/osem.git","ssh_url":"git@github.com:ChrisBr/osem.git","clone_url":"https://github.com/ChrisBr/osem.git","svn_url":"https://github.com/ChrisBr/osem","homepage":null,"size":4988,"stargazers_count":0,"watchers_count":0,"language":"JavaScript","has_issues":true,"has_downloads":true,"has_wiki":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"openSUSE:master","ref":"master","sha":"678fe38a25ca901cafc1fbbb2e9d42716906f68d","user":{"login":"openSUSE","id":623819,"avatar_url":"https://avatars.githubusercontent.com/u/623819?","gravatar_id":"eba8b10e96bfc815a8b7fa8d819e8de1","url":"https://api.github.com/users/openSUSE","html_url":"https://github.com/openSUSE","followers_url":"https://api.github.com/users/openSUSE/followers","following_url":"https://api.github.com/users/openSUSE/following{/other_user}","gists_url":"https://api.github.com/users/openSUSE/gists{/gist_id}","starred_url":"https://api.github.com/users/openSUSE/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/openSUSE/subscriptions","organizations_url":"https://api.github.com/users/openSUSE/orgs","repos_url":"https://api.github.com/users/openSUSE/repos","events_url":"https://api.github.com/users/openSUSE/events{/privacy}","received_events_url":"https://api.github.com/users/openSUSE/received_events","type":"Organization","site_admin":false},"repo":{"id":5911225,"name":"osem","full_name":"openSUSE/osem","owner":{"login":"openSUSE","id":623819,"avatar_url":"https://avatars.githubusercontent.com/u/623819?","gravatar_id":"eba8b10e96bfc815a8b7fa8d819e8de1","url":"https://api.github.com/users/openSUSE","html_url":"https://github.com/openSUSE","followers_url":"https://api.github.com/users/openSUSE/followers","following_url":"https://api.github.com/users/openSUSE/following{/other_user}","gists_url":"https://api.github.com/users/openSUSE/gists{/gist_id}","starred_url":"https://api.github.com/users/openSUSE/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/openSUSE/subscriptions","organizations_url":"https://api.github.com/users/openSUSE/orgs","repos_url":"https://api.github.com/users/openSUSE/repos","events_url":"https://api.github.com/users/openSUSE/events{/privacy}","received_events_url":"https://api.github.com/users/openSUSE/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/openSUSE/osem","description":"Open Source Event Manager","fork":false,"url":"https://api.github.com/repos/openSUSE/osem","forks_url":"https://api.github.com/repos/openSUSE/osem/forks","keys_url":"https://api.github.com/repos/openSUSE/osem/keys{/key_id}","collaborators_url":"https://api.github.com/repos/openSUSE/osem/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/openSUSE/osem/teams","hooks_url":"https://api.github.com/repos/openSUSE/osem/hooks","issue_events_url":"https://api.github.com/repos/openSUSE/osem/issues/events{/number}","events_url":"https://api.github.com/repos/openSUSE/osem/events","assignees_url":"https://api.github.com/repos/openSUSE/osem/assignees{/user}","branches_url":"https://api.github.com/repos/openSUSE/osem/branches{/branch}","tags_url":"https://api.github.com/repos/openSUSE/osem/tags","blobs_url":"https://api.github.com/repos/openSUSE/osem/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/openSUSE/osem/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/openSUSE/osem/git/refs{/sha}","trees_url":"https://api.github.com/repos/openSUSE/osem/git/trees{/sha}","statuses_url":"https://api.github.com/repos/openSUSE/osem/statuses/{sha}","languages_url":"https://api.github.com/repos/openSUSE/osem/languages","stargazers_url":"https://api.github.com/repos/openSUSE/osem/stargazers","contributors_url":"https://api.github.com/repos/openSUSE/osem/contributors","subscribers_url":"https://api.github.com/repos/openSUSE/osem/subscribers","subscription_url":"https://api.github.com/repos/openSUSE/osem/subscription","commits_url":"https://api.github.com/repos/openSUSE/osem/commits{/sha}","git_commits_url":"https://api.github.com/repos/openSUSE/osem/git/commits{/sha}","comments_url":"https://api.github.com/repos/openSUSE/osem/comments{/number}","issue_comment_url":"https://api.github.com/repos/openSUSE/osem/issues/comments/{number}","contents_url":"https://api.github.com/repos/openSUSE/osem/contents/{+path}","compare_url":"https://api.github.com/repos/openSUSE/osem/compare/{base}...{head}","merges_url":"https://api.github.com/repos/openSUSE/osem/merges","archive_url":"https://api.github.com/repos/openSUSE/osem/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/openSUSE/osem/downloads","issues_url":"https://api.github.com/repos/openSUSE/osem/issues{/number}","pulls_url":"https://api.github.com/repos/openSUSE/osem/pulls{/number}","milestones_url":"https://api.github.com/repos/openSUSE/osem/milestones{/number}","notifications_url":"https://api.github.com/repos/openSUSE/osem/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/openSUSE/osem/labels{/name}","releases_url":"https://api.github.com/repos/openSUSE/osem/releases{/id}","created_at":"2012-09-22T07:40:18Z","updated_at":"2014-06-25T14:54:42Z","pushed_at":"2014-06-25T12:16:11Z","git_url":"git://github.com/openSUSE/osem.git","ssh_url":"git@github.com:openSUSE/osem.git","clone_url":"https://github.com/openSUSE/osem.git","svn_url":"https://github.com/openSUSE/osem","homepage":null,"size":8501,"stargazers_count":16,"watchers_count":16,"language":"JavaScript","has_issues":true,"has_downloads":true,"has_wiki":true,"forks_count":18,"mirror_url":null,"open_issues_count":37,"forks":18,"open_issues":37,"watchers":16,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/openSUSE/osem/pulls/266"},"html":{"href":"https://github.com/openSUSE/osem/pull/266"},"issue":{"href":"https://api.github.com/repos/openSUSE/osem/issues/266"},"comments":{"href":"https://api.github.com/repos/openSUSE/osem/issues/266/comments"},"review_comments":{"href":"https://api.github.com/repos/openSUSE/osem/pulls/266/comments"},"review_comment":{"href":"https://api.github.com/repos/openSUSE/osem/pulls/comments/{number}"},"commits":{"href":"https://api.github.com/repos/openSUSE/osem/pulls/266/commits"},"statuses":{"href":"https://api.github.com/repos/openSUSE/osem/statuses/f4a269f55eeaed4346f616403cb516c40530f8fd"}}}}