# frozen_string_literal: true # == Schema Information # # Table name: galleries # # id :integer not null, primary key # description :string default(""), not null # image_count :integer default(0), not null # order_position_asc :boolean default(FALSE), not null # spoiler_warning :string default(""), not null # title :string not null # watcher_count :integer default(0), not null # created_at :datetime not null # updated_at :datetime not null # creator_id :integer not null # thumbnail_id :integer not null # # Indexes # # index_galleries_on_creator_id (creator_id) # index_galleries_on_thumbnail_id (thumbnail_id) # # Foreign Keys # # fk_rails_... (creator_id => users.id) ON DELETE => cascade ON UPDATE => cascade # class GallerySerializer < BaseSerializer # @param [Gallery] gallery def self.serialize(gallery, options = {}) { description: gallery.description, id: gallery.id, spoiler_warning: gallery.spoiler_warning, thumbnail_id: gallery.thumbnail_id, title: gallery.title } end end