app/serializers/illustration_serializer.rb
# frozen_string_literal: true
# == Schema Information
#
# Table name: illustrations
#
# id :bigint(8) not null, primary key
# url :string not null
# url_path :string not null
# size :integer not null
# content_type :string not null
# created_at :datetime not null
# updated_at :datetime not null
# large_url :string default(""), not null
# medium_url :string default(""), not null
# thumb_url :string default(""), not null
#
class IllustrationSerializer < BaseSerializer
attributes :id, :url, :large_url, :thumb_url, :size
attribute :filename do |object|
File.basename(object.url_path)
end
end