lib/meducation_sdk/resources/user.rb in meducation_sdk-0.6.1 vs lib/meducation_sdk/resources/user.rb in meducation_sdk-0.7.0
- old
+ new
@@ -5,10 +5,12 @@
def community_memberships
CommunityMembership.where(user_id: 1)
end
def communities
- Community.where(id: community_memberships.map(&:id))
+ community_membership_ids = community_memberships.map(&:id)
+ return [] if community_membership_ids.empty?
+ Community.where(id: community_membership_ids)
end
def settings
UserSettings.where(user_id: id).first
end