Sha256: 2a9741945756366b50a433fe4005d33fdb309f86f576092dc549a9bc2a88c07f

Contents?: true

Size: 601 Bytes

Versions: 28

Compression:

Stored size: 601 Bytes

Contents

module MeducationSDK
  class BlogPost < Resource
    self.path = "/blog_posts"

    def user
      @user ||= User.find(user_id)
    end

    def blogger
      @blogger ||= Blogger.find(blogger_id)
    end

    def comments
      @comments ||= Comment.where(item_id: id, item_type: "BlogPost")
    end
  end

  class BlogPostMock < BlogPost
    extend Loquor::ResourceMock

    self.attributes = {
      id: 1,
      blogger_id: 8,
      user_id: 14,
      title: "My First Blog Post",
      slug: "my-first-blog-post",
      header_url: '/defaults/blog_posts/headers/missing_card.png'
    }
  end
end

Version data entries

28 entries across 28 versions & 1 rubygems

Version Path
meducation_sdk-2.2.0 lib/meducation_sdk/resources/blog_post.rb
meducation_sdk-2.1.4 lib/meducation_sdk/resources/blog_post.rb
meducation_sdk-2.1.3 lib/meducation_sdk/resources/blog_post.rb
meducation_sdk-2.1.2 lib/meducation_sdk/resources/blog_post.rb
meducation_sdk-2.1.1 lib/meducation_sdk/resources/blog_post.rb
meducation_sdk-2.1.0 lib/meducation_sdk/resources/blog_post.rb
meducation_sdk-2.0.5 lib/meducation_sdk/resources/blog_post.rb
meducation_sdk-2.0.4 lib/meducation_sdk/resources/blog_post.rb
meducation_sdk-2.0.3 lib/meducation_sdk/resources/blog_post.rb
meducation_sdk-2.0.2 lib/meducation_sdk/resources/blog_post.rb
meducation_sdk-2.0.1 lib/meducation_sdk/resources/blog_post.rb
meducation_sdk-2.0.0 lib/meducation_sdk/resources/blog_post.rb
meducation_sdk-1.6.16 lib/meducation_sdk/resources/blog_post.rb
meducation_sdk-1.6.15 lib/meducation_sdk/resources/blog_post.rb
meducation_sdk-1.6.14 lib/meducation_sdk/resources/blog_post.rb
meducation_sdk-1.6.13 lib/meducation_sdk/resources/blog_post.rb
meducation_sdk-1.6.12 lib/meducation_sdk/resources/blog_post.rb
meducation_sdk-1.6.11 lib/meducation_sdk/resources/blog_post.rb
meducation_sdk-1.6.10 lib/meducation_sdk/resources/blog_post.rb
meducation_sdk-1.6.6 lib/meducation_sdk/resources/blog_post.rb