Sha256: 14018dafca6d2fff9240f4413de94dea84d43c194ed3de63178c0ab1e9c6fe88

Contents?: true

Size: 538 Bytes

Versions: 24

Compression:

Stored size: 538 Bytes

Contents

module MeducationSDK
  class GroupDiscussion < Loquor::Resource
    self.path = "/group_discussions"

    def group
      @group ||= Group.find(group_id)
    end

    def started_by
      @started_by ||= User.find(started_by_id)
    end

    def posts
      @posts = GroupDiscussionPost.where(discussion_id: id)
    end
  end

  class GroupDiscussionMock < GroupDiscussion
    extend Loquor::ResourceMock

    self.attributes = {
      id: 1,
      group_id: 8,
      started_by_id: 7,
      title: "My great discussion"
    }
  end
end

Version data entries

24 entries across 24 versions & 1 rubygems

Version Path
meducation_sdk-1.4.3 lib/meducation_sdk/resources/group_discussion.rb
meducation_sdk-1.4.2 lib/meducation_sdk/resources/group_discussion.rb
meducation_sdk-1.4.1 lib/meducation_sdk/resources/group_discussion.rb
meducation_sdk-1.4.0 lib/meducation_sdk/resources/group_discussion.rb
meducation_sdk-1.3.0 lib/meducation_sdk/resources/group_discussion.rb
meducation_sdk-1.2.6 lib/meducation_sdk/resources/group_discussion.rb
meducation_sdk-1.2.5 lib/meducation_sdk/resources/group_discussion.rb
meducation_sdk-1.2.4 lib/meducation_sdk/resources/group_discussion.rb
meducation_sdk-1.2.3 lib/meducation_sdk/resources/group_discussion.rb
meducation_sdk-1.2.2 lib/meducation_sdk/resources/group_discussion.rb
meducation_sdk-1.2.1 lib/meducation_sdk/resources/group_discussion.rb
meducation_sdk-1.2.0 lib/meducation_sdk/resources/group_discussion.rb
meducation_sdk-1.1.2 lib/meducation_sdk/resources/group_discussion.rb
meducation_sdk-1.1.1 lib/meducation_sdk/resources/group_discussion.rb
meducation_sdk-1.1.0 lib/meducation_sdk/resources/group_discussion.rb
meducation_sdk-1.0.0 lib/meducation_sdk/resources/group_discussion.rb
meducation_sdk-0.10.1 lib/meducation_sdk/resources/group_discussion.rb
meducation_sdk-0.10.0 lib/meducation_sdk/resources/group_discussion.rb
meducation_sdk-0.9.0 lib/meducation_sdk/resources/group_discussion.rb
meducation_sdk-0.8.0 lib/meducation_sdk/resources/group_discussion.rb