cliskip2 0.0.6 → 0.0.7
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/cliskip2/client.rb +36 -3
- data/lib/cliskip2/community_participation.rb +1 -1
- data/lib/cliskip2/version.rb +1 -1
- metadata +1 -1
data/lib/cliskip2/client.rb
CHANGED
@@ -83,7 +83,7 @@ module Cliskip2
|
|
83
83
|
inserted_users_count = inserted_users_count + 1
|
84
84
|
end
|
85
85
|
else
|
86
|
-
log_text = " Skipped
|
86
|
+
log_text = " Skipped to sync users. because of blank-email."
|
87
87
|
log_texts << log_text
|
88
88
|
logger.info log_text
|
89
89
|
skipped_users_count = skipped_users_count + 1
|
@@ -145,9 +145,42 @@ module Cliskip2
|
|
145
145
|
|
146
146
|
# Leave from the community by the target-community and params
|
147
147
|
# @return [Cliskip2::CommunityParticipation]
|
148
|
-
def leave_community
|
149
|
-
community_participation_attr = delete("/tenants/#{current_user.tenant_id}/communities/#{
|
148
|
+
def leave_community community_participation
|
149
|
+
community_participation_attr = delete("/tenants/#{current_user.tenant_id}/communities/#{community_participation.community_id}/community_participations/#{community_participation.id}.json")
|
150
150
|
Cliskip2::CommunityParticipation.new(community_participation_attr['community_participation'])
|
151
151
|
end
|
152
|
+
|
153
|
+
# Search communitiy_participatioms by some conditions
|
154
|
+
# @return [Array<Cliskip2::Community>]
|
155
|
+
def search_members params
|
156
|
+
if user_id = params.delete(:user_id)
|
157
|
+
community_participation_attrs = get("/admin/tenants/#{current_user.tenant_id}/users/#{user_id}/community_participations.json", params)
|
158
|
+
community_participation_attrs.map { |community_participation_attr| Cliskip2::CommunityParticipation.new(community_participation_attr['community_participation']) }
|
159
|
+
else
|
160
|
+
[]
|
161
|
+
end
|
162
|
+
end
|
163
|
+
|
164
|
+
# Join some communities by some conditions
|
165
|
+
# @return [Array<Cliskip2::CommunityParticipation>]
|
166
|
+
def join_communities params
|
167
|
+
if user_id = params.delete(:user_id)
|
168
|
+
community_participation_attrs = post("/admin/tenants/#{current_user.tenant_id}/users/#{user_id}/community_participations/join_communities.json", params)
|
169
|
+
community_participation_attrs.map { |community_participation_attr| Cliskip2::CommunityParticipation.new(community_participation_attr['community_participation']) }
|
170
|
+
else
|
171
|
+
[]
|
172
|
+
end
|
173
|
+
end
|
174
|
+
|
175
|
+
# Leave from some communities by some conditions
|
176
|
+
# @return [Array<Cliskip2::CommunityParticipation>]
|
177
|
+
def leave_communities params
|
178
|
+
if user_id = params.delete(:user_id)
|
179
|
+
community_participation_attrs = delete("/admin/tenants/#{current_user.tenant_id}/users/#{user_id}/community_participations/leave_communities.json", params)
|
180
|
+
community_participation_attrs.map { |community_participation_attr| Cliskip2::CommunityParticipation.new(community_participation_attr['community_participation']) }
|
181
|
+
else
|
182
|
+
[]
|
183
|
+
end
|
184
|
+
end
|
152
185
|
end
|
153
186
|
end
|
data/lib/cliskip2/version.rb
CHANGED