Sha256: 5a961f4ba1ce63b505303b086ca6439faf6be0d50512fcecb6bfdfd6d7e81006

Contents?: true

Size: 454 Bytes

Versions: 2

Compression:

Stored size: 454 Bytes

Contents

module Strain
  class Jsonapi::ArticleResource < JSONAPI::Resource
    model_name "::Strain::Article"

    attribute :slug
    attribute :title
    attribute :variant_id
    # attribute :variant
    attribute :schema
    attribute :variant_name
    attribute :body

    relationship :variant, to: :one

    # https://github.com/cerebris/jsonapi-resources/issues/523
    def self.resource_type_for(model)
      'strain/jsonapi/article'
    end

  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
strain-0.0.2 app/resources/strain/jsonapi/article_resource.rb
strain-0.0.1 app/resources/strain/jsonapi/article_resource.rb