Sha256: 3689ec2807d4df9390c4f796d1673f26c60b75e1b352423a7dcd61faedc2cc4b
Contents?: true
Size: 768 Bytes
Versions: 24
Compression:
Stored size: 768 Bytes
Contents
module SirTrevorRails module Blocks ## # Multi-up featured page block class FeaturedPagesBlock < SirTrevorRails::Block include Displayable def page_options(id) (items.detect { |x| x[:id] == id }) || {} end def pages @pages ||= parent.exhibit.pages.published.where(slug: item_ids).sort do |a, b| ordered_items.index(a.slug) <=> ordered_items.index(b.slug) end end def pages? !pages.empty? end def as_json result = super result[:data][:item] ||= {} result[:data][:item].each_value do |v| v['thumbnail_image_url'] = parent.exhibit.pages.find(v['id']).thumbnail_image_url end result end end end end
Version data entries
24 entries across 24 versions & 1 rubygems