Sha256: 3c5406a583bf08a5f2df82d528f96931a6090ea0602d47c73f206143b393b9a6
Contents?: true
Size: 477 Bytes
Versions: 8
Compression:
Stored size: 477 Bytes
Contents
# frozen_string_literal: true module C module Previewable extend ActiveSupport::Concern included do def preview_body if !self.class.column_names.include?('preview_body') || super.blank? if body.present? ActionController::Base.helpers.strip_tags(body.gsub(%r{<h(\d)>.*?<\/h(\1)>}, '')).truncate(150, strip_tags: true) else '' end else super end end end end end
Version data entries
8 entries across 8 versions & 1 rubygems