app/serializers/blueprint_serializer.rb
# frozen_string_literal: true
# == Schema Information
#
# Table name: blueprints
#
# 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
# thumb_url :string default(""), not null
# preview :boolean default(FALSE)
#
class BlueprintSerializer < BaseSerializer
attributes :id, :url, :thumb_url, :size
attribute :filename do |object|
File.basename(object.url_path)
end
end