{"action":"created","comment":{"url":"https://api.github.com/repos/fsek/web/pulls/comments/212384315","pull_request_review_id":149005775,"id":212384315,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDIxMjM4NDMxNQ==","diff_hunk":"@@ -0,0 +1,80 @@\n+class Admin::AdventureMissionsController < Admin::BaseController\n+  before_action :set_introduction_and_adventure_from_url, only: [:index, :new, :create]\n+  before_action :set_introduction_and_adventure_from_object, only: [:show, :edit, :update, :destroy]\n+  load_permissions_and_authorize_resource through: :adventure\n+\n+  def index\n+    @grid = initialize_grid(@adventure_missions, locale: :sv, order: 'adventure_missions.index')\n+  end\n+\n+  def new\n+    @adventure_mission = AdventureMission.new\n+    @suggested_index = @adventure.adventure_missions.count\n+  end\n+\n+  def create\n+    @adventure_mission = AdventureMission.new(adventure_mission_params)\n+\n+    if @adventure.adventure_missions.pluck(:index).include?(adventure_mission_params[:index].to_i)","path":"app/controllers/admin/adventure_missions_controller.rb","position":18,"original_position":18,"commit_id":"5a2c9d383f696e5450034fd203d943178e36b1e5","original_commit_id":"5a2c9d383f696e5450034fd203d943178e36b1e5","user":{"login":"navro","id":16032644,"node_id":"MDQ6VXNlcjE2MDMyNjQ0","avatar_url":"https://avatars0.githubusercontent.com/u/16032644?v=4","gravatar_id":"","url":"https://api.github.com/users/navro","html_url":"https://github.com/navro","followers_url":"https://api.github.com/users/navro/followers","following_url":"https://api.github.com/users/navro/following{/other_user}","gists_url":"https://api.github.com/users/navro/gists{/gist_id}","starred_url":"https://api.github.com/users/navro/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/navro/subscriptions","organizations_url":"https://api.github.com/users/navro/orgs","repos_url":"https://api.github.com/users/navro/repos","events_url":"https://api.github.com/users/navro/events{/privacy}","received_events_url":"https://api.github.com/users/navro/received_events","type":"User","site_admin":false},"body":"I think you can do this in a very simple SQL query","created_at":"2018-08-23T17:00:35Z","updated_at":"2018-08-23T17:00:35Z","html_url":"https://github.com/fsek/web/pull/832#discussion_r212384315","pull_request_url":"https://api.github.com/repos/fsek/web/pulls/832","author_association":"MEMBER","_links":{"self":{"href":"https://api.github.com/repos/fsek/web/pulls/comments/212384315"},"html":{"href":"https://github.com/fsek/web/pull/832#discussion_r212384315"},"pull_request":{"href":"https://api.github.com/repos/fsek/web/pulls/832"}},"in_reply_to_id":212380821},"pull_request":{"url":"https://api.github.com/repos/fsek/web/pulls/832","id":210292493,"node_id":"MDExOlB1bGxSZXF1ZXN0MjEwMjkyNDkz","html_url":"https://github.com/fsek/web/pull/832","diff_url":"https://github.com/fsek/web/pull/832.diff","patch_url":"https://github.com/fsek/web/pull/832.patch","issue_url":"https://api.github.com/repos/fsek/web/issues/832","number":832,"state":"open","locked":false,"title":"Adventure improvements and some migration changes","user":{"login":"olofenglund96","id":6953059,"node_id":"MDQ6VXNlcjY5NTMwNTk=","avatar_url":"https://avatars0.githubusercontent.com/u/6953059?v=4","gravatar_id":"","url":"https://api.github.com/users/olofenglund96","html_url":"https://github.com/olofenglund96","followers_url":"https://api.github.com/users/olofenglund96/followers","following_url":"https://api.github.com/users/olofenglund96/following{/other_user}","gists_url":"https://api.github.com/users/olofenglund96/gists{/gist_id}","starred_url":"https://api.github.com/users/olofenglund96/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/olofenglund96/subscriptions","organizations_url":"https://api.github.com/users/olofenglund96/orgs","repos_url":"https://api.github.com/users/olofenglund96/repos","events_url":"https://api.github.com/users/olofenglund96/events{/privacy}","received_events_url":"https://api.github.com/users/olofenglund96/received_events","type":"User","site_admin":false},"body":"This PR might be a bit messy (due to a small lack of time) so all code checking and feedback is very welcome!\r\n\r\nNow the adventures are more elaborate with several missions connected to an adventure.\r\n\r\n- Admin interface for creating missions\r\n- Member interface for finishing missions and viewing progress\r\n- Api for the app to finish missions and view progress\r\n\r\nI made some changes to the migrations due to rails now enforcing version numbers on all migrations. I added rails 5.0 to all migrations without any supporting argument so please let me know if that is bad!","created_at":"2018-08-22T23:32:30Z","updated_at":"2018-08-23T17:00:35Z","closed_at":null,"merged_at":null,"merge_commit_sha":"6dab0e8616c47325135a3a82eb036e14e2854e64","assignee":null,"assignees":[],"requested_reviewers":[{"login":"FredrikLastow","id":25156930,"node_id":"MDQ6VXNlcjI1MTU2OTMw","avatar_url":"https://avatars2.githubusercontent.com/u/25156930?v=4","gravatar_id":"","url":"https://api.github.com/users/FredrikLastow","html_url":"https://github.com/FredrikLastow","followers_url":"https://api.github.com/users/FredrikLastow/followers","following_url":"https://api.github.com/users/FredrikLastow/following{/other_user}","gists_url":"https://api.github.com/users/FredrikLastow/gists{/gist_id}","starred_url":"https://api.github.com/users/FredrikLastow/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/FredrikLastow/subscriptions","organizations_url":"https://api.github.com/users/FredrikLastow/orgs","repos_url":"https://api.github.com/users/FredrikLastow/repos","events_url":"https://api.github.com/users/FredrikLastow/events{/privacy}","received_events_url":"https://api.github.com/users/FredrikLastow/received_events","type":"User","site_admin":false},{"login":"davidkrantz","id":26110611,"node_id":"MDQ6VXNlcjI2MTEwNjEx","avatar_url":"https://avatars2.githubusercontent.com/u/26110611?v=4","gravatar_id":"","url":"https://api.github.com/users/davidkrantz","html_url":"https://github.com/davidkrantz","followers_url":"https://api.github.com/users/davidkrantz/followers","following_url":"https://api.github.com/users/davidkrantz/following{/other_user}","gists_url":"https://api.github.com/users/davidkrantz/gists{/gist_id}","starred_url":"https://api.github.com/users/davidkrantz/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/davidkrantz/subscriptions","organizations_url":"https://api.github.com/users/davidkrantz/orgs","repos_url":"https://api.github.com/users/davidkrantz/repos","events_url":"https://api.github.com/users/davidkrantz/events{/privacy}","received_events_url":"https://api.github.com/users/davidkrantz/received_events","type":"User","site_admin":false}],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/fsek/web/pulls/832/commits","review_comments_url":"https://api.github.com/repos/fsek/web/pulls/832/comments","review_comment_url":"https://api.github.com/repos/fsek/web/pulls/comments{/number}","comments_url":"https://api.github.com/repos/fsek/web/issues/832/comments","statuses_url":"https://api.github.com/repos/fsek/web/statuses/5a2c9d383f696e5450034fd203d943178e36b1e5","head":{"label":"fsek:olof-adventures","ref":"olof-adventures","sha":"5a2c9d383f696e5450034fd203d943178e36b1e5","user":{"login":"fsek","id":10084654,"node_id":"MDEyOk9yZ2FuaXphdGlvbjEwMDg0NjU0","avatar_url":"https://avatars0.githubusercontent.com/u/10084654?v=4","gravatar_id":"","url":"https://api.github.com/users/fsek","html_url":"https://github.com/fsek","followers_url":"https://api.github.com/users/fsek/followers","following_url":"https://api.github.com/users/fsek/following{/other_user}","gists_url":"https://api.github.com/users/fsek/gists{/gist_id}","starred_url":"https://api.github.com/users/fsek/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/fsek/subscriptions","organizations_url":"https://api.github.com/users/fsek/orgs","repos_url":"https://api.github.com/users/fsek/repos","events_url":"https://api.github.com/users/fsek/events{/privacy}","received_events_url":"https://api.github.com/users/fsek/received_events","type":"Organization","site_admin":false},"repo":{"id":27583674,"node_id":"MDEwOlJlcG9zaXRvcnkyNzU4MzY3NA==","name":"web","full_name":"fsek/web","owner":{"login":"fsek","id":10084654,"node_id":"MDEyOk9yZ2FuaXphdGlvbjEwMDg0NjU0","avatar_url":"https://avatars0.githubusercontent.com/u/10084654?v=4","gravatar_id":"","url":"https://api.github.com/users/fsek","html_url":"https://github.com/fsek","followers_url":"https://api.github.com/users/fsek/followers","following_url":"https://api.github.com/users/fsek/following{/other_user}","gists_url":"https://api.github.com/users/fsek/gists{/gist_id}","starred_url":"https://api.github.com/users/fsek/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/fsek/subscriptions","organizations_url":"https://api.github.com/users/fsek/orgs","repos_url":"https://api.github.com/users/fsek/repos","events_url":"https://api.github.com/users/fsek/events{/privacy}","received_events_url":"https://api.github.com/users/fsek/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/fsek/web","description":"The website of the F-guild at TLTH","fork":false,"url":"https://api.github.com/repos/fsek/web","forks_url":"https://api.github.com/repos/fsek/web/forks","keys_url":"https://api.github.com/repos/fsek/web/keys{/key_id}","collaborators_url":"https://api.github.com/repos/fsek/web/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/fsek/web/teams","hooks_url":"https://api.github.com/repos/fsek/web/hooks","issue_events_url":"https://api.github.com/repos/fsek/web/issues/events{/number}","events_url":"https://api.github.com/repos/fsek/web/events","assignees_url":"https://api.github.com/repos/fsek/web/assignees{/user}","branches_url":"https://api.github.com/repos/fsek/web/branches{/branch}","tags_url":"https://api.github.com/repos/fsek/web/tags","blobs_url":"https://api.github.com/repos/fsek/web/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/fsek/web/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/fsek/web/git/refs{/sha}","trees_url":"https://api.github.com/repos/fsek/web/git/trees{/sha}","statuses_url":"https://api.github.com/repos/fsek/web/statuses/{sha}","languages_url":"https://api.github.com/repos/fsek/web/languages","stargazers_url":"https://api.github.com/repos/fsek/web/stargazers","contributors_url":"https://api.github.com/repos/fsek/web/contributors","subscribers_url":"https://api.github.com/repos/fsek/web/subscribers","subscription_url":"https://api.github.com/repos/fsek/web/subscription","commits_url":"https://api.github.com/repos/fsek/web/commits{/sha}","git_commits_url":"https://api.github.com/repos/fsek/web/git/commits{/sha}","comments_url":"https://api.github.com/repos/fsek/web/comments{/number}","issue_comment_url":"https://api.github.com/repos/fsek/web/issues/comments{/number}","contents_url":"https://api.github.com/repos/fsek/web/contents/{+path}","compare_url":"https://api.github.com/repos/fsek/web/compare/{base}...{head}","merges_url":"https://api.github.com/repos/fsek/web/merges","archive_url":"https://api.github.com/repos/fsek/web/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/fsek/web/downloads","issues_url":"https://api.github.com/repos/fsek/web/issues{/number}","pulls_url":"https://api.github.com/repos/fsek/web/pulls{/number}","milestones_url":"https://api.github.com/repos/fsek/web/milestones{/number}","notifications_url":"https://api.github.com/repos/fsek/web/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/fsek/web/labels{/name}","releases_url":"https://api.github.com/repos/fsek/web/releases{/id}","deployments_url":"https://api.github.com/repos/fsek/web/deployments","created_at":"2014-12-05T09:13:19Z","updated_at":"2018-07-29T12:52:02Z","pushed_at":"2018-08-23T11:09:57Z","git_url":"git://github.com/fsek/web.git","ssh_url":"git@github.com:fsek/web.git","clone_url":"https://github.com/fsek/web.git","svn_url":"https://github.com/fsek/web","homepage":"https://fsektionen.se","size":216957,"stargazers_count":13,"watchers_count":13,"language":"Ruby","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":2,"mirror_url":null,"archived":false,"open_issues_count":23,"license":{"key":"mit","name":"MIT License","spdx_id":"MIT","url":"https://api.github.com/licenses/mit","node_id":"MDc6TGljZW5zZTEz"},"forks":2,"open_issues":23,"watchers":13,"default_branch":"master"}},"base":{"label":"fsek:master","ref":"master","sha":"b3172dc8faa6787967de748d8f763757895dad4f","user":{"login":"fsek","id":10084654,"node_id":"MDEyOk9yZ2FuaXphdGlvbjEwMDg0NjU0","avatar_url":"https://avatars0.githubusercontent.com/u/10084654?v=4","gravatar_id":"","url":"https://api.github.com/users/fsek","html_url":"https://github.com/fsek","followers_url":"https://api.github.com/users/fsek/followers","following_url":"https://api.github.com/users/fsek/following{/other_user}","gists_url":"https://api.github.com/users/fsek/gists{/gist_id}","starred_url":"https://api.github.com/users/fsek/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/fsek/subscriptions","organizations_url":"https://api.github.com/users/fsek/orgs","repos_url":"https://api.github.com/users/fsek/repos","events_url":"https://api.github.com/users/fsek/events{/privacy}","received_events_url":"https://api.github.com/users/fsek/received_events","type":"Organization","site_admin":false},"repo":{"id":27583674,"node_id":"MDEwOlJlcG9zaXRvcnkyNzU4MzY3NA==","name":"web","full_name":"fsek/web","owner":{"login":"fsek","id":10084654,"node_id":"MDEyOk9yZ2FuaXphdGlvbjEwMDg0NjU0","avatar_url":"https://avatars0.githubusercontent.com/u/10084654?v=4","gravatar_id":"","url":"https://api.github.com/users/fsek","html_url":"https://github.com/fsek","followers_url":"https://api.github.com/users/fsek/followers","following_url":"https://api.github.com/users/fsek/following{/other_user}","gists_url":"https://api.github.com/users/fsek/gists{/gist_id}","starred_url":"https://api.github.com/users/fsek/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/fsek/subscriptions","organizations_url":"https://api.github.com/users/fsek/orgs","repos_url":"https://api.github.com/users/fsek/repos","events_url":"https://api.github.com/users/fsek/events{/privacy}","received_events_url":"https://api.github.com/users/fsek/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/fsek/web","description":"The website of the F-guild at TLTH","fork":false,"url":"https://api.github.com/repos/fsek/web","forks_url":"https://api.github.com/repos/fsek/web/forks","keys_url":"https://api.github.com/repos/fsek/web/keys{/key_id}","collaborators_url":"https://api.github.com/repos/fsek/web/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/fsek/web/teams","hooks_url":"https://api.github.com/repos/fsek/web/hooks","issue_events_url":"https://api.github.com/repos/fsek/web/issues/events{/number}","events_url":"https://api.github.com/repos/fsek/web/events","assignees_url":"https://api.github.com/repos/fsek/web/assignees{/user}","branches_url":"https://api.github.com/repos/fsek/web/branches{/branch}","tags_url":"https://api.github.com/repos/fsek/web/tags","blobs_url":"https://api.github.com/repos/fsek/web/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/fsek/web/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/fsek/web/git/refs{/sha}","trees_url":"https://api.github.com/repos/fsek/web/git/trees{/sha}","statuses_url":"https://api.github.com/repos/fsek/web/statuses/{sha}","languages_url":"https://api.github.com/repos/fsek/web/languages","stargazers_url":"https://api.github.com/repos/fsek/web/stargazers","contributors_url":"https://api.github.com/repos/fsek/web/contributors","subscribers_url":"https://api.github.com/repos/fsek/web/subscribers","subscription_url":"https://api.github.com/repos/fsek/web/subscription","commits_url":"https://api.github.com/repos/fsek/web/commits{/sha}","git_commits_url":"https://api.github.com/repos/fsek/web/git/commits{/sha}","comments_url":"https://api.github.com/repos/fsek/web/comments{/number}","issue_comment_url":"https://api.github.com/repos/fsek/web/issues/comments{/number}","contents_url":"https://api.github.com/repos/fsek/web/contents/{+path}","compare_url":"https://api.github.com/repos/fsek/web/compare/{base}...{head}","merges_url":"https://api.github.com/repos/fsek/web/merges","archive_url":"https://api.github.com/repos/fsek/web/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/fsek/web/downloads","issues_url":"https://api.github.com/repos/fsek/web/issues{/number}","pulls_url":"https://api.github.com/repos/fsek/web/pulls{/number}","milestones_url":"https://api.github.com/repos/fsek/web/milestones{/number}","notifications_url":"https://api.github.com/repos/fsek/web/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/fsek/web/labels{/name}","releases_url":"https://api.github.com/repos/fsek/web/releases{/id}","deployments_url":"https://api.github.com/repos/fsek/web/deployments","created_at":"2014-12-05T09:13:19Z","updated_at":"2018-07-29T12:52:02Z","pushed_at":"2018-08-23T11:09:57Z","git_url":"git://github.com/fsek/web.git","ssh_url":"git@github.com:fsek/web.git","clone_url":"https://github.com/fsek/web.git","svn_url":"https://github.com/fsek/web","homepage":"https://fsektionen.se","size":216957,"stargazers_count":13,"watchers_count":13,"language":"Ruby","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":2,"mirror_url":null,"archived":false,"open_issues_count":23,"license":{"key":"mit","name":"MIT License","spdx_id":"MIT","url":"https://api.github.com/licenses/mit","node_id":"MDc6TGljZW5zZTEz"},"forks":2,"open_issues":23,"watchers":13,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/fsek/web/pulls/832"},"html":{"href":"https://github.com/fsek/web/pull/832"},"issue":{"href":"https://api.github.com/repos/fsek/web/issues/832"},"comments":{"href":"https://api.github.com/repos/fsek/web/issues/832/comments"},"review_comments":{"href":"https://api.github.com/repos/fsek/web/pulls/832/comments"},"review_comment":{"href":"https://api.github.com/repos/fsek/web/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/fsek/web/pulls/832/commits"},"statuses":{"href":"https://api.github.com/repos/fsek/web/statuses/5a2c9d383f696e5450034fd203d943178e36b1e5"}},"author_association":"CONTRIBUTOR"}}
{"actor":{"display_login":"navro"}}