hummingbird-me/kitsu-server

View on GitHub
app/resources/upload_resource.rb

Summary

Maintainability
A
0 mins
Test Coverage
B
84%
class UploadResource < BaseResource
  include ScopelessResource
  include RankedResource

  attribute :content, format: :shrine_attachment
  attribute :upload_order
  ranks :upload_order

  def content
    _model.content_attacher
  end

  def content=(value)
    _model.content_data_uri = value
  end

  has_one :user
  has_one :owner, polymorhic: true

  filters :id, :user_id, :owner_id, :owner_type
end