{"action":"created","comment":{"url":"https://api.github.com/repos/danfstucky/LeagueSpec/pulls/comments/68407286","id":68407286,"diff_hunk":"@@ -19,12 +34,116 @@ def create\n       redirect_to root_url\n     else \n       render 'new'\n+      \n     end\n   end\n \n+  \n+\n   private\n \n   def user_params\n     params.require(:user).permit(:name, :email, :password, :password_confirmation)\n   end\n+\n+\n+  def verify_summoner_name\n+    begin\n+      @summonerReq = Lol::SummonerRequest.new Rails.application.secrets.sulai_api_key, \"na\"\n+      @summonerObj = @summonerReq.by_name(user_params[:name]).first\n+    rescue Lol::NotFound => e\n+      if e.message == '404 Not Found'\n+        flash[:danger] = \"Summoner name has to be registered. Register on the LoL website and return here to sign up\"\n+        redirect_to new_profile_path\n+      end\n+    end\n+  end\n+\n+  def get_summoner\n+    @summonerReq = Lol::SummonerRequest.new Rails.application.secrets.sulai_api_key, \"na\"\n+    @summonerObj = @summonerReq.by_name(User.find(params[:id]).name).first\n+  end\n+  \n+  #Static Request is used to retrieve info on any of champion, item, mastery, rune summoner_spell\n+  def get_champion_request\n+    @champsReq = Lol::StaticRequest.new Rails.application.secrets.sulai_api_key, \"na\"\n+  end\n+\n+  def get_summoner_ranked_stats\n+    @statsReq = Lol::StatsRequest.new Rails.application.secrets.sulai_api_key, \"na\"\n+    @statsObj = @statsReq.ranked(@summonerObj.id, extra = {})\n+    #Since the champion with id = 0 always returns 404 error and is used for error checking, I am deleting it from the array.\n+    @statsObj.champions.delete_if{ |h| h.id == 0 }\n+  end\n+\n+  def get_most_played_champ\n+    #Most played champion is returned by sorting by total sessions played descending and returning second champion.\n+    #First champion does not exist - refer below\n+    #Most summoners I have tried have ID = 0 for champions with the highest total session played.\n+    #However, I had trouble retrieving this champion and after researching for a while, I found that champion with ID = 0 does not exist and\n+    #is only used to deal with exceptions. Linked here - https://market.mashape.com/community/elophant-league-of-legends\n+    @mostPlayedChampObj = @statsObj.champions.sort_by{|x| -x.stats.total_sessions_played}\n+    @mostPlayedChampObj = @mostPlayedChampObj.paginate(:page => params[:page], :per_page => 5)\n+  end\n+\n+  def get_overall_WLR\n+    #OverallWLR\n+    @overallLosses = 0","path":"app/controllers/profiles_controller.rb","position":84,"original_position":84,"commit_id":"799ad427236de5dc9afbd52cf18b94d6f85fdbb9","original_commit_id":"799ad427236de5dc9afbd52cf18b94d6f85fdbb9","user":{"login":"danfstucky","id":13394759,"avatar_url":"https://avatars.githubusercontent.com/u/13394759?v=3","gravatar_id":"","url":"https://api.github.com/users/danfstucky","html_url":"https://github.com/danfstucky","followers_url":"https://api.github.com/users/danfstucky/followers","following_url":"https://api.github.com/users/danfstucky/following{/other_user}","gists_url":"https://api.github.com/users/danfstucky/gists{/gist_id}","starred_url":"https://api.github.com/users/danfstucky/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/danfstucky/subscriptions","organizations_url":"https://api.github.com/users/danfstucky/orgs","repos_url":"https://api.github.com/users/danfstucky/repos","events_url":"https://api.github.com/users/danfstucky/events{/privacy}","received_events_url":"https://api.github.com/users/danfstucky/received_events","type":"User","site_admin":false},"body":"If you never use a variable outside of a particular function, then you should make it local instead of an instance variable.","created_at":"2016-06-24T14:36:57Z","updated_at":"2016-06-24T14:36:57Z","html_url":"https://github.com/danfstucky/LeagueSpec/pull/24#discussion_r68407286","pull_request_url":"https://api.github.com/repos/danfstucky/LeagueSpec/pulls/24","_links":{"self":{"href":"https://api.github.com/repos/danfstucky/LeagueSpec/pulls/comments/68407286"},"html":{"href":"https://github.com/danfstucky/LeagueSpec/pull/24#discussion_r68407286"},"pull_request":{"href":"https://api.github.com/repos/danfstucky/LeagueSpec/pulls/24"}}},"pull_request":{"url":"https://api.github.com/repos/danfstucky/LeagueSpec/pulls/24","id":74887492,"html_url":"https://github.com/danfstucky/LeagueSpec/pull/24","diff_url":"https://github.com/danfstucky/LeagueSpec/pull/24.diff","patch_url":"https://github.com/danfstucky/LeagueSpec/pull/24.patch","issue_url":"https://api.github.com/repos/danfstucky/LeagueSpec/issues/24","number":24,"state":"open","locked":false,"title":"Profile page pull request for Issue #22","user":{"login":"sl7v3","id":11051775,"avatar_url":"https://avatars.githubusercontent.com/u/11051775?v=3","gravatar_id":"","url":"https://api.github.com/users/sl7v3","html_url":"https://github.com/sl7v3","followers_url":"https://api.github.com/users/sl7v3/followers","following_url":"https://api.github.com/users/sl7v3/following{/other_user}","gists_url":"https://api.github.com/users/sl7v3/gists{/gist_id}","starred_url":"https://api.github.com/users/sl7v3/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sl7v3/subscriptions","organizations_url":"https://api.github.com/users/sl7v3/orgs","repos_url":"https://api.github.com/users/sl7v3/repos","events_url":"https://api.github.com/users/sl7v3/events{/privacy}","received_events_url":"https://api.github.com/users/sl7v3/received_events","type":"User","site_admin":false},"body":"@danfstucky @jwiebe17 Created a validation method to verify that Summoner Names already exist in LoL database before allowing them to sign up:\r\nFound sample summoner names at: http://www.mobafire.com/league-of-legends/players?sort_type=seen_ts&sort_order=&name=&server=NA&elo_min=&elo_max=\r\nVerified that summoner names exist and are still valid at: http://lolnamecheck.jj.ai/\r\nInvalid summoner names don't save to DB and are redirected to signup page with appropriate message\r\n\r\nProfile display features\r\nDisplay Champions/Summoner info as specified by user requirements.\r\nUsed a demo picture for all champions\r\n\r\nExtra: \r\nCapitalized signed in username in navbar","created_at":"2016-06-23T02:32:22Z","updated_at":"2016-06-24T14:36:57Z","closed_at":null,"merged_at":null,"merge_commit_sha":null,"assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/danfstucky/LeagueSpec/pulls/24/commits","review_comments_url":"https://api.github.com/repos/danfstucky/LeagueSpec/pulls/24/comments","review_comment_url":"https://api.github.com/repos/danfstucky/LeagueSpec/pulls/comments{/number}","comments_url":"https://api.github.com/repos/danfstucky/LeagueSpec/issues/24/comments","statuses_url":"https://api.github.com/repos/danfstucky/LeagueSpec/statuses/799ad427236de5dc9afbd52cf18b94d6f85fdbb9","head":{"label":"danfstucky:profile-page","ref":"profile-page","sha":"799ad427236de5dc9afbd52cf18b94d6f85fdbb9","user":{"login":"danfstucky","id":13394759,"avatar_url":"https://avatars.githubusercontent.com/u/13394759?v=3","gravatar_id":"","url":"https://api.github.com/users/danfstucky","html_url":"https://github.com/danfstucky","followers_url":"https://api.github.com/users/danfstucky/followers","following_url":"https://api.github.com/users/danfstucky/following{/other_user}","gists_url":"https://api.github.com/users/danfstucky/gists{/gist_id}","starred_url":"https://api.github.com/users/danfstucky/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/danfstucky/subscriptions","organizations_url":"https://api.github.com/users/danfstucky/orgs","repos_url":"https://api.github.com/users/danfstucky/repos","events_url":"https://api.github.com/users/danfstucky/events{/privacy}","received_events_url":"https://api.github.com/users/danfstucky/received_events","type":"User","site_admin":false},"repo":{"id":48957128,"name":"LeagueSpec","full_name":"danfstucky/LeagueSpec","owner":{"login":"danfstucky","id":13394759,"avatar_url":"https://avatars.githubusercontent.com/u/13394759?v=3","gravatar_id":"","url":"https://api.github.com/users/danfstucky","html_url":"https://github.com/danfstucky","followers_url":"https://api.github.com/users/danfstucky/followers","following_url":"https://api.github.com/users/danfstucky/following{/other_user}","gists_url":"https://api.github.com/users/danfstucky/gists{/gist_id}","starred_url":"https://api.github.com/users/danfstucky/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/danfstucky/subscriptions","organizations_url":"https://api.github.com/users/danfstucky/orgs","repos_url":"https://api.github.com/users/danfstucky/repos","events_url":"https://api.github.com/users/danfstucky/events{/privacy}","received_events_url":"https://api.github.com/users/danfstucky/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/danfstucky/LeagueSpec","description":"","fork":false,"url":"https://api.github.com/repos/danfstucky/LeagueSpec","forks_url":"https://api.github.com/repos/danfstucky/LeagueSpec/forks","keys_url":"https://api.github.com/repos/danfstucky/LeagueSpec/keys{/key_id}","collaborators_url":"https://api.github.com/repos/danfstucky/LeagueSpec/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/danfstucky/LeagueSpec/teams","hooks_url":"https://api.github.com/repos/danfstucky/LeagueSpec/hooks","issue_events_url":"https://api.github.com/repos/danfstucky/LeagueSpec/issues/events{/number}","events_url":"https://api.github.com/repos/danfstucky/LeagueSpec/events","assignees_url":"https://api.github.com/repos/danfstucky/LeagueSpec/assignees{/user}","branches_url":"https://api.github.com/repos/danfstucky/LeagueSpec/branches{/branch}","tags_url":"https://api.github.com/repos/danfstucky/LeagueSpec/tags","blobs_url":"https://api.github.com/repos/danfstucky/LeagueSpec/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/danfstucky/LeagueSpec/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/danfstucky/LeagueSpec/git/refs{/sha}","trees_url":"https://api.github.com/repos/danfstucky/LeagueSpec/git/trees{/sha}","statuses_url":"https://api.github.com/repos/danfstucky/LeagueSpec/statuses/{sha}","languages_url":"https://api.github.com/repos/danfstucky/LeagueSpec/languages","stargazers_url":"https://api.github.com/repos/danfstucky/LeagueSpec/stargazers","contributors_url":"https://api.github.com/repos/danfstucky/LeagueSpec/contributors","subscribers_url":"https://api.github.com/repos/danfstucky/LeagueSpec/subscribers","subscription_url":"https://api.github.com/repos/danfstucky/LeagueSpec/subscription","commits_url":"https://api.github.com/repos/danfstucky/LeagueSpec/commits{/sha}","git_commits_url":"https://api.github.com/repos/danfstucky/LeagueSpec/git/commits{/sha}","comments_url":"https://api.github.com/repos/danfstucky/LeagueSpec/comments{/number}","issue_comment_url":"https://api.github.com/repos/danfstucky/LeagueSpec/issues/comments{/number}","contents_url":"https://api.github.com/repos/danfstucky/LeagueSpec/contents/{+path}","compare_url":"https://api.github.com/repos/danfstucky/LeagueSpec/compare/{base}...{head}","merges_url":"https://api.github.com/repos/danfstucky/LeagueSpec/merges","archive_url":"https://api.github.com/repos/danfstucky/LeagueSpec/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/danfstucky/LeagueSpec/downloads","issues_url":"https://api.github.com/repos/danfstucky/LeagueSpec/issues{/number}","pulls_url":"https://api.github.com/repos/danfstucky/LeagueSpec/pulls{/number}","milestones_url":"https://api.github.com/repos/danfstucky/LeagueSpec/milestones{/number}","notifications_url":"https://api.github.com/repos/danfstucky/LeagueSpec/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/danfstucky/LeagueSpec/labels{/name}","releases_url":"https://api.github.com/repos/danfstucky/LeagueSpec/releases{/id}","deployments_url":"https://api.github.com/repos/danfstucky/LeagueSpec/deployments","created_at":"2016-01-03T18:58:41Z","updated_at":"2016-01-12T01:13:00Z","pushed_at":"2016-06-24T14:25:26Z","git_url":"git://github.com/danfstucky/LeagueSpec.git","ssh_url":"git@github.com:danfstucky/LeagueSpec.git","clone_url":"https://github.com/danfstucky/LeagueSpec.git","svn_url":"https://github.com/danfstucky/LeagueSpec","homepage":null,"size":9536,"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":7,"forks":0,"open_issues":7,"watchers":0,"default_branch":"master"}},"base":{"label":"danfstucky:master","ref":"master","sha":"d6861f4b96e7fc8deb641cb06d74ee366938f56d","user":{"login":"danfstucky","id":13394759,"avatar_url":"https://avatars.githubusercontent.com/u/13394759?v=3","gravatar_id":"","url":"https://api.github.com/users/danfstucky","html_url":"https://github.com/danfstucky","followers_url":"https://api.github.com/users/danfstucky/followers","following_url":"https://api.github.com/users/danfstucky/following{/other_user}","gists_url":"https://api.github.com/users/danfstucky/gists{/gist_id}","starred_url":"https://api.github.com/users/danfstucky/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/danfstucky/subscriptions","organizations_url":"https://api.github.com/users/danfstucky/orgs","repos_url":"https://api.github.com/users/danfstucky/repos","events_url":"https://api.github.com/users/danfstucky/events{/privacy}","received_events_url":"https://api.github.com/users/danfstucky/received_events","type":"User","site_admin":false},"repo":{"id":48957128,"name":"LeagueSpec","full_name":"danfstucky/LeagueSpec","owner":{"login":"danfstucky","id":13394759,"avatar_url":"https://avatars.githubusercontent.com/u/13394759?v=3","gravatar_id":"","url":"https://api.github.com/users/danfstucky","html_url":"https://github.com/danfstucky","followers_url":"https://api.github.com/users/danfstucky/followers","following_url":"https://api.github.com/users/danfstucky/following{/other_user}","gists_url":"https://api.github.com/users/danfstucky/gists{/gist_id}","starred_url":"https://api.github.com/users/danfstucky/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/danfstucky/subscriptions","organizations_url":"https://api.github.com/users/danfstucky/orgs","repos_url":"https://api.github.com/users/danfstucky/repos","events_url":"https://api.github.com/users/danfstucky/events{/privacy}","received_events_url":"https://api.github.com/users/danfstucky/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/danfstucky/LeagueSpec","description":"","fork":false,"url":"https://api.github.com/repos/danfstucky/LeagueSpec","forks_url":"https://api.github.com/repos/danfstucky/LeagueSpec/forks","keys_url":"https://api.github.com/repos/danfstucky/LeagueSpec/keys{/key_id}","collaborators_url":"https://api.github.com/repos/danfstucky/LeagueSpec/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/danfstucky/LeagueSpec/teams","hooks_url":"https://api.github.com/repos/danfstucky/LeagueSpec/hooks","issue_events_url":"https://api.github.com/repos/danfstucky/LeagueSpec/issues/events{/number}","events_url":"https://api.github.com/repos/danfstucky/LeagueSpec/events","assignees_url":"https://api.github.com/repos/danfstucky/LeagueSpec/assignees{/user}","branches_url":"https://api.github.com/repos/danfstucky/LeagueSpec/branches{/branch}","tags_url":"https://api.github.com/repos/danfstucky/LeagueSpec/tags","blobs_url":"https://api.github.com/repos/danfstucky/LeagueSpec/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/danfstucky/LeagueSpec/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/danfstucky/LeagueSpec/git/refs{/sha}","trees_url":"https://api.github.com/repos/danfstucky/LeagueSpec/git/trees{/sha}","statuses_url":"https://api.github.com/repos/danfstucky/LeagueSpec/statuses/{sha}","languages_url":"https://api.github.com/repos/danfstucky/LeagueSpec/languages","stargazers_url":"https://api.github.com/repos/danfstucky/LeagueSpec/stargazers","contributors_url":"https://api.github.com/repos/danfstucky/LeagueSpec/contributors","subscribers_url":"https://api.github.com/repos/danfstucky/LeagueSpec/subscribers","subscription_url":"https://api.github.com/repos/danfstucky/LeagueSpec/subscription","commits_url":"https://api.github.com/repos/danfstucky/LeagueSpec/commits{/sha}","git_commits_url":"https://api.github.com/repos/danfstucky/LeagueSpec/git/commits{/sha}","comments_url":"https://api.github.com/repos/danfstucky/LeagueSpec/comments{/number}","issue_comment_url":"https://api.github.com/repos/danfstucky/LeagueSpec/issues/comments{/number}","contents_url":"https://api.github.com/repos/danfstucky/LeagueSpec/contents/{+path}","compare_url":"https://api.github.com/repos/danfstucky/LeagueSpec/compare/{base}...{head}","merges_url":"https://api.github.com/repos/danfstucky/LeagueSpec/merges","archive_url":"https://api.github.com/repos/danfstucky/LeagueSpec/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/danfstucky/LeagueSpec/downloads","issues_url":"https://api.github.com/repos/danfstucky/LeagueSpec/issues{/number}","pulls_url":"https://api.github.com/repos/danfstucky/LeagueSpec/pulls{/number}","milestones_url":"https://api.github.com/repos/danfstucky/LeagueSpec/milestones{/number}","notifications_url":"https://api.github.com/repos/danfstucky/LeagueSpec/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/danfstucky/LeagueSpec/labels{/name}","releases_url":"https://api.github.com/repos/danfstucky/LeagueSpec/releases{/id}","deployments_url":"https://api.github.com/repos/danfstucky/LeagueSpec/deployments","created_at":"2016-01-03T18:58:41Z","updated_at":"2016-01-12T01:13:00Z","pushed_at":"2016-06-24T14:25:26Z","git_url":"git://github.com/danfstucky/LeagueSpec.git","ssh_url":"git@github.com:danfstucky/LeagueSpec.git","clone_url":"https://github.com/danfstucky/LeagueSpec.git","svn_url":"https://github.com/danfstucky/LeagueSpec","homepage":null,"size":9536,"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":7,"forks":0,"open_issues":7,"watchers":0,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/danfstucky/LeagueSpec/pulls/24"},"html":{"href":"https://github.com/danfstucky/LeagueSpec/pull/24"},"issue":{"href":"https://api.github.com/repos/danfstucky/LeagueSpec/issues/24"},"comments":{"href":"https://api.github.com/repos/danfstucky/LeagueSpec/issues/24/comments"},"review_comments":{"href":"https://api.github.com/repos/danfstucky/LeagueSpec/pulls/24/comments"},"review_comment":{"href":"https://api.github.com/repos/danfstucky/LeagueSpec/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/danfstucky/LeagueSpec/pulls/24/commits"},"statuses":{"href":"https://api.github.com/repos/danfstucky/LeagueSpec/statuses/799ad427236de5dc9afbd52cf18b94d6f85fdbb9"}}}}
{"actor":{"display_login":"danfstucky"}}