aboutsummaryrefslogtreecommitdiff
path: root/app/controllers/memberships_controller.rb
diff options
context:
space:
mode:
Diffstat (limited to 'app/controllers/memberships_controller.rb')
-rw-r--r--app/controllers/memberships_controller.rb21
1 files changed, 1 insertions, 20 deletions
diff --git a/app/controllers/memberships_controller.rb b/app/controllers/memberships_controller.rb
index 5a5cf6d..6a7bd50 100644
--- a/app/controllers/memberships_controller.rb
+++ b/app/controllers/memberships_controller.rb
@@ -28,26 +28,7 @@ class MembershipsController < ApplicationController
end
def index
- memberships = []
- Membership.for_participant_id(@participant.id).each do |membership|
- memberships <<
- { :community => lambda { |memb|
- attribs = memb.community_with_reduced_attributes.attributes
- id = attribs["id"]; attribs.delete("id"); attribs["cid"] = id
- attribs
- }.call(membership),
- :participants => membership.community.participants.with_reduced_attributes_and_without_anonymous.map {|p|
- attribs = p.attributes
- 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
- }
- }
- end
+ memberships = Membership.memberships(@participant)
if memberships.empty?
render :text => "", :content_type => "application/json", :layout => false
else