hummingbird-me/kitsu-server

View on GitHub
app/resources/chapter_resource.rb

Summary

Maintainability
A
0 mins
Test Coverage
B
84%
class ChapterResource < BaseResource
  caching

  attribute :synopsis # DEPRECATED
  def synopsis
    description
  end

  attribute :description
  def description
    _model.description['en']
  end

  attributes :titles, :canonical_title, :volume_number, :number,
    :published, :length
  attribute :thumbnail, format: :shrine_attachment, delegate: :thumbnail_attacher

  has_one :manga

  filters :manga_id
  filter :number, verify: ->(values, _context) { values.map(&:to_i) }
end