You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
pgfqe6ch8/app/views/members/show.api.rsb

15 lines
530 B

api.membership do
api.id @member.id
api.project :id => @member.project.id, :name => @member.project.name
api.__send__ @member.principal.class.name.underscore, :id => @member.principal.id, :name => @member.principal.name
api.array :roles do
@member.member_roles.each do |member_role|
if member_role.role
attrs = {:id => member_role.role.id, :name => member_role.role.name}
attrs.merge!(:inherited => true) if member_role.inherited_from.present?
api.role attrs
end
end
end
end