Sha256: 06689063e9679c8fcb9df462ec16152bcf36ab54cde2fd1656f6fb9da32913ca

Contents?: true

Size: 414 Bytes

Versions: 16

Compression:

Stored size: 414 Bytes

Contents

require 'htmlentities'

module Qbrick
  class TextBrick < Brick
    include ActionView::Helpers::SanitizeHelper
    HTML_ENTITIES = HTMLEntities.new

    validates :text, presence: true

    def user_can_add_childs?
      false
    end

    def collect_fulltext
      HTML_ENTITIES.decode(
        strip_tags([
          text,
          read_more_text
        ].compact.join(' ')).squish
      )
    end
  end
end

Version data entries

16 entries across 16 versions & 1 rubygems

Version Path
qbrick-2.7.1 app/models/qbrick/text_brick.rb
qbrick-2.7 app/models/qbrick/text_brick.rb
qbrick-2.6.10 app/models/qbrick/text_brick.rb
qbrick-2.6.9 app/models/qbrick/text_brick.rb
qbrick-2.6.8 app/models/qbrick/text_brick.rb
qbrick-2.6.7 app/models/qbrick/text_brick.rb
qbrick-2.6.6 app/models/qbrick/text_brick.rb
qbrick-2.6.5 app/models/qbrick/text_brick.rb
qbrick-2.6.4 app/models/qbrick/text_brick.rb
qbrick-2.6.3 app/models/qbrick/text_brick.rb
qbrick-2.6.2 app/models/qbrick/text_brick.rb
qbrick-2.6.1 app/models/qbrick/text_brick.rb
qbrick-2.6.0 app/models/qbrick/text_brick.rb
qbrick-2.5.2 app/models/qbrick/text_brick.rb
qbrick-2.5.1 app/models/qbrick/text_brick.rb
qbrick-2.5.0 app/models/qbrick/text_brick.rb