summaryrefslogtreecommitdiff
path: root/app/controllers
diff options
context:
space:
mode:
authornfoy <nfoy@purdue.edu>2014-04-26 23:45:25 -0400
committernfoy <nfoy@purdue.edu>2014-04-26 23:45:25 -0400
commit6f19b51f0adf95b1d9bd8317388ecdbcb3756be7 (patch)
treec4be583ba9db126ef58db7a1900468ec0929df25 /app/controllers
parent9d8d6b023ce3390f3ccf9808e630505a15ebebe6 (diff)
parent9dd899559e4533c61089c3f9429574d2de20925e (diff)
Merge branch 'master' of https://github.com/LukeShu/leaguer
Diffstat (limited to 'app/controllers')
-rw-r--r--app/controllers/alerts_controller.rb7
-rw-r--r--app/controllers/tournaments_controller.rb8
-rw-r--r--app/controllers/users_controller.rb15
3 files changed, 14 insertions, 16 deletions
diff --git a/app/controllers/alerts_controller.rb b/app/controllers/alerts_controller.rb
index 1d09864..77ca8b9 100644
--- a/app/controllers/alerts_controller.rb
+++ b/app/controllers/alerts_controller.rb
@@ -25,9 +25,12 @@ class AlertsController < ApplicationController
@alert = Alert.new(alert_params)
@alert.author = current_user
users = {}
- users = Users.all
+ users = User.all
- #current_user.send_message(users, @alert.message, "Pay Attention!")
+
+ for i in 0..users.length
+ current_user.send_message(users[i], @alert.message, "Pay Attention!")
+ end
respond_to do |format|
if @alert.save
diff --git a/app/controllers/tournaments_controller.rb b/app/controllers/tournaments_controller.rb
index 60f8789..734253a 100644
--- a/app/controllers/tournaments_controller.rb
+++ b/app/controllers/tournaments_controller.rb
@@ -67,6 +67,14 @@ class TournamentsController < ApplicationController
end
end
+ def create_stage
+
+ # stage = @tournament.stages.new
+ # stage.create(TODO:PARAMETERS)
+ # @tournament.stages.push(stage)
+
+ end
+
# PATCH/PUT /tournaments/1
# PATCH/PUT /tournaments/1.json
def update
diff --git a/app/controllers/users_controller.rb b/app/controllers/users_controller.rb
index 27b3c61..767d992 100644
--- a/app/controllers/users_controller.rb
+++ b/app/controllers/users_controller.rb
@@ -62,20 +62,7 @@ class UsersController < ApplicationController
else
params[:user][:remote_usernames].each do |game_name,user_name|
game = Game.find_by_name(game_name)
- remote_username = HTTParty.get("https://prod.api.pvp.net/api/lol/na/v1.3/summoner/by-name/#{user_name.downcase}?api_key=ad539f86-22fd-474d-9279-79a7a296ac38")
-
- id = "#{remote_username["#{user_name.downcase}"]["id"]}".to_i
- username = "#{remote_username["#{user_name.downcase}"]["name"]}"
-
- hash = {:username => username, :id => id}
-
- remote = @user.remote_usernames.where(:game => game).first
- if remote.nil?
- ok &= @user.remote_usernames.create(game: game, value: hash)
- else
- remote.value = hash
- ok &= remote.save
- end
+ Sampling::RiotApi::set_remote_name(@user, game, user_name)
end
end
respond_to do |format|