Sha256: b248285c681f81c55cb227786fa6e12c1feb55ef9c977b6216d28e67a7c041d5
Contents?: true
Size: 1006 Bytes
Versions: 3
Compression:
Stored size: 1006 Bytes
Contents
module MeducationSDK class User < Resource self.path = "/users" def community_memberships CommunityMembership.where(user_id: 1) end def communities community_membership_ids = community_memberships.map(&:id) return [] if community_membership_ids.empty? Community.where(id: community_membership_ids) end def email_preferences UserEmailPreferences.where(user_id: id).first end def settings UserSettings.where(user_id: id).first end end class UserMock < User extend Loquor::ResourceMock self.attributes = { id: 1, first_name: "Jeremy", surname: "Walker", name: "Jeremy Walker", short_display_name: "Jeremy", photo_url: "http://i.telegraph.co.uk/multimedia/archive/02351/cross-eyed-cat_2351472k.jpg", primary_email_address: "jez.walker@gmail.com", url_code: "asd1234567", is_site_admin: false, reputation: 1023, viewable_collections: [] } end end
Version data entries
3 entries across 3 versions & 1 rubygems
Version | Path |
---|---|
meducation_sdk-2.2.2 | lib/meducation_sdk/resources/user.rb |
meducation_sdk-2.2.1 | lib/meducation_sdk/resources/user.rb |
meducation_sdk-2.2.0 | lib/meducation_sdk/resources/user.rb |