diff options
author | Heiko Bernloehr <Heiko.Bernloehr@FreeIT.de> | 2012-11-04 10:04:20 +0100 |
---|---|---|
committer | Heiko Bernloehr <Heiko.Bernloehr@FreeIT.de> | 2012-11-04 15:12:24 +0100 |
commit | 6de9a0e78c8d8ffe4e192daec0847d8852a437f0 (patch) | |
tree | 6ae9dffadc25d20cc6695097eaa6a623d5f2b8b5 | |
parent | 27323b75fca480caa9055017cb86e87f35de057e (diff) | |
download | ecs2-6de9a0e78c8d8ffe4e192daec0847d8852a437f0.tar.gz ecs2-6de9a0e78c8d8ffe4e192daec0847d8852a437f0.zip |
pid in memberships.
The memberships resource now returns also the pid (participant id) of
each participant.
-rw-r--r-- | app/controllers/memberships_controller.rb | 1 | ||||
-rw-r--r-- | app/models/message.rb | 1 |
2 files changed, 2 insertions, 0 deletions
diff --git a/app/controllers/memberships_controller.rb b/app/controllers/memberships_controller.rb index e518c33..5a5cf6d 100644 --- a/app/controllers/memberships_controller.rb +++ b/app/controllers/memberships_controller.rb @@ -41,6 +41,7 @@ class MembershipsController < ApplicationController attribs["mid"] = Membership.for_participant_id_and_community_id(p.id, membership.community.id).first.id attribs["org"] = {"name" => p.organization.name, "abbr" => p.organization.abrev} attribs["itsyou"] = p.id == @participant.id + attribs["pid"] = p.id attribs.delete("id") attribs.delete("organization_id") attribs diff --git a/app/models/message.rb b/app/models/message.rb index 0eb89ff..4a89778 100644 --- a/app/models/message.rb +++ b/app/models/message.rb @@ -238,6 +238,7 @@ class Message < ActiveRecord::Base b["abbr"] = participant.organization.abrev one_touch_token_hash = Digest::SHA1.hexdigest(rand.to_s+Time.now.to_s) b["hash"] = one_touch_token_hash + b["pid"] = participant.id self.body = JSON.pretty_generate(b) self.auth = Auth.new :one_touch_hash => one_touch_token_hash save! |