# frozen_string_literal: true module C class Testimonial < ApplicationRecord include Orderable include Imageable validates :quote, :author, presence: true belongs_to :project, optional: true def quote_teaser if quote.length > 150 quote.truncate(150) else quote end end INDEX_TABLE = { "Quote": { call: 'quote' }, "Author": { call: 'author' }, "Created": { call: 'created_at' }, "Delete": { link: { name: { text: 'Delete' }, options: '[object]', method: :delete, data: { confirm: 'Are you sure?' } } } }.freeze end end