Sha256: 84f699492efaf0633eb777494481434ff4406be364dccbaf2f0736ced042eff1

Contents?: true

Size: 617 Bytes

Versions: 6

Compression:

Stored size: 617 Bytes

Contents

# frozen_string_literal: true

module Decidim
  # This concern contains the logic related to hashtaggable resources.
  module Hashtaggable
    extend ActiveSupport::Concern

    included do
      def search_title
        renderer = Decidim::ContentRenderers::HashtagRenderer.new(title)
        renderer.render(links: false).html_safe
      end

      alias_method :formatted_title, :search_title

      def search_body
        renderer = Decidim::ContentRenderers::HashtagRenderer.new(body)
        renderer.render(links: false).html_safe
      end

      alias_method :formatted_body, :search_body
    end
  end
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
decidim-core-0.22.0 lib/decidim/hashtaggable.rb
decidim-core-0.21.0 lib/decidim/hashtaggable.rb
decidim-core-0.20.1 lib/decidim/hashtaggable.rb
decidim-core-0.20.0 lib/decidim/hashtaggable.rb
decidim-core-0.19.1 lib/decidim/hashtaggable.rb
decidim-core-0.19.0 lib/decidim/hashtaggable.rb