{"action":"created","comment":{"url":"https://api.github.com/repos/isnoto/flashcards/pulls/comments/46010107","id":46010107,"diff_hunk":"@@ -1,10 +1,26 @@\n class ApplicationController < ActionController::Base\n-  # Prevent CSRF attacks by raising an exception.\n-  # For APIs, you may want to use :null_session instead.\n   protect_from_forgery with: :exception\n+  before_action :set_locale\n+\n+  def set_locale\n+    locale = if current_user\n+               current_user.locale\n+             elsif params[:locale]\n+               session[:locale] = params[:locale]\n+             elsif session[:locale]\n+               session[:locale]\n+             else\n+               http_accept_language.compatible_language_from(I18n.available_locales)","path":"app/controllers/application_controller.rb","position":15,"original_position":15,"commit_id":"23119194322f388919da1b6799215569f6049fac","original_commit_id":"23119194322f388919da1b6799215569f6049fac","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":"Line is too long. [84/80]","created_at":"2015-11-26T23:21:43Z","updated_at":"2015-11-26T23:21:43Z","html_url":"https://github.com/isnoto/flashcards/pull/19#discussion_r46010107","pull_request_url":"https://api.github.com/repos/isnoto/flashcards/pulls/19","_links":{"self":{"href":"https://api.github.com/repos/isnoto/flashcards/pulls/comments/46010107"},"html":{"href":"https://github.com/isnoto/flashcards/pull/19#discussion_r46010107"},"pull_request":{"href":"https://api.github.com/repos/isnoto/flashcards/pulls/19"}}},"pull_request":{"url":"https://api.github.com/repos/isnoto/flashcards/pulls/19","id":51855343,"html_url":"https://github.com/isnoto/flashcards/pull/19","diff_url":"https://github.com/isnoto/flashcards/pull/19.diff","patch_url":"https://github.com/isnoto/flashcards/pull/19.patch","issue_url":"https://api.github.com/repos/isnoto/flashcards/issues/19","number":19,"state":"open","locked":false,"title":"I18n","user":{"login":"isnoto","id":10686712,"avatar_url":"https://avatars.githubusercontent.com/u/10686712?v=3","gravatar_id":"","url":"https://api.github.com/users/isnoto","html_url":"https://github.com/isnoto","followers_url":"https://api.github.com/users/isnoto/followers","following_url":"https://api.github.com/users/isnoto/following{/other_user}","gists_url":"https://api.github.com/users/isnoto/gists{/gist_id}","starred_url":"https://api.github.com/users/isnoto/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/isnoto/subscriptions","organizations_url":"https://api.github.com/users/isnoto/orgs","repos_url":"https://api.github.com/users/isnoto/repos","events_url":"https://api.github.com/users/isnoto/events{/privacy}","received_events_url":"https://api.github.com/users/isnoto/received_events","type":"User","site_admin":false},"body":"","created_at":"2015-11-25T22:56:32Z","updated_at":"2015-11-26T23:21:43Z","closed_at":null,"merged_at":null,"merge_commit_sha":"e0ab5c54949525eacd6f86407201d4bd4c4bc4dc","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/isnoto/flashcards/pulls/19/commits","review_comments_url":"https://api.github.com/repos/isnoto/flashcards/pulls/19/comments","review_comment_url":"https://api.github.com/repos/isnoto/flashcards/pulls/comments{/number}","comments_url":"https://api.github.com/repos/isnoto/flashcards/issues/19/comments","statuses_url":"https://api.github.com/repos/isnoto/flashcards/statuses/23119194322f388919da1b6799215569f6049fac","head":{"label":"isnoto:sixteenth-task","ref":"sixteenth-task","sha":"23119194322f388919da1b6799215569f6049fac","user":{"login":"isnoto","id":10686712,"avatar_url":"https://avatars.githubusercontent.com/u/10686712?v=3","gravatar_id":"","url":"https://api.github.com/users/isnoto","html_url":"https://github.com/isnoto","followers_url":"https://api.github.com/users/isnoto/followers","following_url":"https://api.github.com/users/isnoto/following{/other_user}","gists_url":"https://api.github.com/users/isnoto/gists{/gist_id}","starred_url":"https://api.github.com/users/isnoto/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/isnoto/subscriptions","organizations_url":"https://api.github.com/users/isnoto/orgs","repos_url":"https://api.github.com/users/isnoto/repos","events_url":"https://api.github.com/users/isnoto/events{/privacy}","received_events_url":"https://api.github.com/users/isnoto/received_events","type":"User","site_admin":false},"repo":{"id":42663356,"name":"flashcards","full_name":"isnoto/flashcards","owner":{"login":"isnoto","id":10686712,"avatar_url":"https://avatars.githubusercontent.com/u/10686712?v=3","gravatar_id":"","url":"https://api.github.com/users/isnoto","html_url":"https://github.com/isnoto","followers_url":"https://api.github.com/users/isnoto/followers","following_url":"https://api.github.com/users/isnoto/following{/other_user}","gists_url":"https://api.github.com/users/isnoto/gists{/gist_id}","starred_url":"https://api.github.com/users/isnoto/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/isnoto/subscriptions","organizations_url":"https://api.github.com/users/isnoto/orgs","repos_url":"https://api.github.com/users/isnoto/repos","events_url":"https://api.github.com/users/isnoto/events{/privacy}","received_events_url":"https://api.github.com/users/isnoto/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/isnoto/flashcards","description":"","fork":false,"url":"https://api.github.com/repos/isnoto/flashcards","forks_url":"https://api.github.com/repos/isnoto/flashcards/forks","keys_url":"https://api.github.com/repos/isnoto/flashcards/keys{/key_id}","collaborators_url":"https://api.github.com/repos/isnoto/flashcards/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/isnoto/flashcards/teams","hooks_url":"https://api.github.com/repos/isnoto/flashcards/hooks","issue_events_url":"https://api.github.com/repos/isnoto/flashcards/issues/events{/number}","events_url":"https://api.github.com/repos/isnoto/flashcards/events","assignees_url":"https://api.github.com/repos/isnoto/flashcards/assignees{/user}","branches_url":"https://api.github.com/repos/isnoto/flashcards/branches{/branch}","tags_url":"https://api.github.com/repos/isnoto/flashcards/tags","blobs_url":"https://api.github.com/repos/isnoto/flashcards/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/isnoto/flashcards/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/isnoto/flashcards/git/refs{/sha}","trees_url":"https://api.github.com/repos/isnoto/flashcards/git/trees{/sha}","statuses_url":"https://api.github.com/repos/isnoto/flashcards/statuses/{sha}","languages_url":"https://api.github.com/repos/isnoto/flashcards/languages","stargazers_url":"https://api.github.com/repos/isnoto/flashcards/stargazers","contributors_url":"https://api.github.com/repos/isnoto/flashcards/contributors","subscribers_url":"https://api.github.com/repos/isnoto/flashcards/subscribers","subscription_url":"https://api.github.com/repos/isnoto/flashcards/subscription","commits_url":"https://api.github.com/repos/isnoto/flashcards/commits{/sha}","git_commits_url":"https://api.github.com/repos/isnoto/flashcards/git/commits{/sha}","comments_url":"https://api.github.com/repos/isnoto/flashcards/comments{/number}","issue_comment_url":"https://api.github.com/repos/isnoto/flashcards/issues/comments{/number}","contents_url":"https://api.github.com/repos/isnoto/flashcards/contents/{+path}","compare_url":"https://api.github.com/repos/isnoto/flashcards/compare/{base}...{head}","merges_url":"https://api.github.com/repos/isnoto/flashcards/merges","archive_url":"https://api.github.com/repos/isnoto/flashcards/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/isnoto/flashcards/downloads","issues_url":"https://api.github.com/repos/isnoto/flashcards/issues{/number}","pulls_url":"https://api.github.com/repos/isnoto/flashcards/pulls{/number}","milestones_url":"https://api.github.com/repos/isnoto/flashcards/milestones{/number}","notifications_url":"https://api.github.com/repos/isnoto/flashcards/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/isnoto/flashcards/labels{/name}","releases_url":"https://api.github.com/repos/isnoto/flashcards/releases{/id}","created_at":"2015-09-17T15:09:40Z","updated_at":"2015-09-22T21:20:37Z","pushed_at":"2015-11-26T23:21:33Z","git_url":"git://github.com/isnoto/flashcards.git","ssh_url":"git@github.com:isnoto/flashcards.git","clone_url":"https://github.com/isnoto/flashcards.git","svn_url":"https://github.com/isnoto/flashcards","homepage":null,"size":207,"stargazers_count":0,"watchers_count":0,"language":"Ruby","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":1,"forks":0,"open_issues":1,"watchers":0,"default_branch":"master"}},"base":{"label":"isnoto:master","ref":"master","sha":"43de83eac58d5cc8eedfce150fdbba8a52371022","user":{"login":"isnoto","id":10686712,"avatar_url":"https://avatars.githubusercontent.com/u/10686712?v=3","gravatar_id":"","url":"https://api.github.com/users/isnoto","html_url":"https://github.com/isnoto","followers_url":"https://api.github.com/users/isnoto/followers","following_url":"https://api.github.com/users/isnoto/following{/other_user}","gists_url":"https://api.github.com/users/isnoto/gists{/gist_id}","starred_url":"https://api.github.com/users/isnoto/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/isnoto/subscriptions","organizations_url":"https://api.github.com/users/isnoto/orgs","repos_url":"https://api.github.com/users/isnoto/repos","events_url":"https://api.github.com/users/isnoto/events{/privacy}","received_events_url":"https://api.github.com/users/isnoto/received_events","type":"User","site_admin":false},"repo":{"id":42663356,"name":"flashcards","full_name":"isnoto/flashcards","owner":{"login":"isnoto","id":10686712,"avatar_url":"https://avatars.githubusercontent.com/u/10686712?v=3","gravatar_id":"","url":"https://api.github.com/users/isnoto","html_url":"https://github.com/isnoto","followers_url":"https://api.github.com/users/isnoto/followers","following_url":"https://api.github.com/users/isnoto/following{/other_user}","gists_url":"https://api.github.com/users/isnoto/gists{/gist_id}","starred_url":"https://api.github.com/users/isnoto/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/isnoto/subscriptions","organizations_url":"https://api.github.com/users/isnoto/orgs","repos_url":"https://api.github.com/users/isnoto/repos","events_url":"https://api.github.com/users/isnoto/events{/privacy}","received_events_url":"https://api.github.com/users/isnoto/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/isnoto/flashcards","description":"","fork":false,"url":"https://api.github.com/repos/isnoto/flashcards","forks_url":"https://api.github.com/repos/isnoto/flashcards/forks","keys_url":"https://api.github.com/repos/isnoto/flashcards/keys{/key_id}","collaborators_url":"https://api.github.com/repos/isnoto/flashcards/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/isnoto/flashcards/teams","hooks_url":"https://api.github.com/repos/isnoto/flashcards/hooks","issue_events_url":"https://api.github.com/repos/isnoto/flashcards/issues/events{/number}","events_url":"https://api.github.com/repos/isnoto/flashcards/events","assignees_url":"https://api.github.com/repos/isnoto/flashcards/assignees{/user}","branches_url":"https://api.github.com/repos/isnoto/flashcards/branches{/branch}","tags_url":"https://api.github.com/repos/isnoto/flashcards/tags","blobs_url":"https://api.github.com/repos/isnoto/flashcards/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/isnoto/flashcards/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/isnoto/flashcards/git/refs{/sha}","trees_url":"https://api.github.com/repos/isnoto/flashcards/git/trees{/sha}","statuses_url":"https://api.github.com/repos/isnoto/flashcards/statuses/{sha}","languages_url":"https://api.github.com/repos/isnoto/flashcards/languages","stargazers_url":"https://api.github.com/repos/isnoto/flashcards/stargazers","contributors_url":"https://api.github.com/repos/isnoto/flashcards/contributors","subscribers_url":"https://api.github.com/repos/isnoto/flashcards/subscribers","subscription_url":"https://api.github.com/repos/isnoto/flashcards/subscription","commits_url":"https://api.github.com/repos/isnoto/flashcards/commits{/sha}","git_commits_url":"https://api.github.com/repos/isnoto/flashcards/git/commits{/sha}","comments_url":"https://api.github.com/repos/isnoto/flashcards/comments{/number}","issue_comment_url":"https://api.github.com/repos/isnoto/flashcards/issues/comments{/number}","contents_url":"https://api.github.com/repos/isnoto/flashcards/contents/{+path}","compare_url":"https://api.github.com/repos/isnoto/flashcards/compare/{base}...{head}","merges_url":"https://api.github.com/repos/isnoto/flashcards/merges","archive_url":"https://api.github.com/repos/isnoto/flashcards/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/isnoto/flashcards/downloads","issues_url":"https://api.github.com/repos/isnoto/flashcards/issues{/number}","pulls_url":"https://api.github.com/repos/isnoto/flashcards/pulls{/number}","milestones_url":"https://api.github.com/repos/isnoto/flashcards/milestones{/number}","notifications_url":"https://api.github.com/repos/isnoto/flashcards/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/isnoto/flashcards/labels{/name}","releases_url":"https://api.github.com/repos/isnoto/flashcards/releases{/id}","created_at":"2015-09-17T15:09:40Z","updated_at":"2015-09-22T21:20:37Z","pushed_at":"2015-11-26T23:21:33Z","git_url":"git://github.com/isnoto/flashcards.git","ssh_url":"git@github.com:isnoto/flashcards.git","clone_url":"https://github.com/isnoto/flashcards.git","svn_url":"https://github.com/isnoto/flashcards","homepage":null,"size":207,"stargazers_count":0,"watchers_count":0,"language":"Ruby","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":1,"forks":0,"open_issues":1,"watchers":0,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/isnoto/flashcards/pulls/19"},"html":{"href":"https://github.com/isnoto/flashcards/pull/19"},"issue":{"href":"https://api.github.com/repos/isnoto/flashcards/issues/19"},"comments":{"href":"https://api.github.com/repos/isnoto/flashcards/issues/19/comments"},"review_comments":{"href":"https://api.github.com/repos/isnoto/flashcards/pulls/19/comments"},"review_comment":{"href":"https://api.github.com/repos/isnoto/flashcards/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/isnoto/flashcards/pulls/19/commits"},"statuses":{"href":"https://api.github.com/repos/isnoto/flashcards/statuses/23119194322f388919da1b6799215569f6049fac"}}}}