summaryrefslogtreecommitdiff
path: root/app/controllers
diff options
context:
space:
mode:
authortkimia <tkimia@purdue.edu>2014-04-24 19:06:48 -0400
committertkimia <tkimia@purdue.edu>2014-04-24 19:06:48 -0400
commitafaf547a9685be8fd15c4496c3c1716e717b3fd7 (patch)
tree8c3e4c5b8a3accab6ec25dc956e27f37b44ccb8f /app/controllers
parentc909eb46740a1daeaf8fac1d60d0e4539f01e342 (diff)
parent1b11684986136ee87da6242c3ba6aba5ef581510 (diff)
Merge branch 'master' of https://github.com/LukeShu/leaguer
Diffstat (limited to 'app/controllers')
-rw-r--r--app/controllers/matches_controller.rb4
-rw-r--r--app/controllers/pms_controller.rb10
2 files changed, 9 insertions, 5 deletions
diff --git a/app/controllers/matches_controller.rb b/app/controllers/matches_controller.rb
index 1ad86d0..138cf28 100644
--- a/app/controllers/matches_controller.rb
+++ b/app/controllers/matches_controller.rb
@@ -23,8 +23,8 @@ class MatchesController < ApplicationController
@match.teams.each do |team|
team.users.each do |user|
- players_id.push(user.remote_usernames[0]["json_value"]["id"])
- players.push(user.remote_usernames[0]["json_value"]["id"])
+ players_id.push(user.remote_usernames[0].value["id"])
+ players.push(user.remote_usernames[0].value["name"])
end
end
diff --git a/app/controllers/pms_controller.rb b/app/controllers/pms_controller.rb
index 1d6540d..9dbe760 100644
--- a/app/controllers/pms_controller.rb
+++ b/app/controllers/pms_controller.rb
@@ -24,11 +24,11 @@ class PmsController < ApplicationController
def create
@pm = Pm.new(pm_params)
@pm.author = current_user
- require 'pp'
- pp @pm.message
+ #require 'pp'
+ #pp @pm.message
@pm.recipient = User.find_by_user_name(pm_params['recipient_id'])
- @pm.author.send_message(@pm.recipient, @pm.message, 'Default')
+ @pm.conversation = @pm.author.send_message(@pm.recipient, @pm.message, @pm.subject).conversation
respond_to do |format|
if @pm.save
@@ -41,6 +41,10 @@ class PmsController < ApplicationController
end
end
+ #def reply
+ # current_user.reply_to_conversation(conversation, message)
+ #end
+
# PATCH/PUT /pms/1
# PATCH/PUT /pms/1.json
def update