Class: C::Testimonial

Inherits:
ApplicationRecord show all
Includes:
Imageable, Orderable
Defined in:
app/models/c/testimonial.rb

Constant Summary collapse

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

Instance Method Summary collapse

Instance Method Details

#quote_teaserObject



10
11
12
13
14
15
16
# File 'app/models/c/testimonial.rb', line 10

def quote_teaser
  if quote.length > 150
    quote.truncate(150)
  else
    quote
  end
end