Sha256: 95788b3d1129794b11a41e279160552e9a3e3ac8a5adeb4272942ba47bec1dd7

Contents?: true

Size: 423 Bytes

Versions: 36

Compression:

Stored size: 423 Bytes

Contents

class ContentText < ApplicationRecord
  include Concerns::ContentType

  # This triggers the searchable instance's after_save callback, which
  # in turn updates all search indices.
  after_save { parent.save! if linked_to_searchable_parent? }

  def content_type
    :text
  end

  def linked_to_searchable_parent?
    column.present? && parent.present? && parent.respond_to?(:searchable?) && parent.searchable?
  end
end

Version data entries

36 entries across 36 versions & 1 rubygems

Version Path
udongo-7.9.0 app/models/content_text.rb
udongo-7.8.1 app/models/content_text.rb
udongo-7.8.0 app/models/content_text.rb
udongo-7.7.2 app/models/content_text.rb
udongo-7.7.1 app/models/content_text.rb
udongo-7.7.0 app/models/content_text.rb
udongo-7.6.2 app/models/content_text.rb
udongo-7.6.1 app/models/content_text.rb
udongo-7.6.0 app/models/content_text.rb
udongo-7.5.1 app/models/content_text.rb
udongo-7.5.0 app/models/content_text.rb
udongo-7.4.2 app/models/content_text.rb
udongo-7.4.1 app/models/content_text.rb
udongo-7.4.0 app/models/content_text.rb
udongo-7.3.5 app/models/content_text.rb
udongo-7.3.4 app/models/content_text.rb
udongo-7.3.3 app/models/content_text.rb
udongo-7.3.2 app/models/content_text.rb
udongo-7.3.1 app/models/content_text.rb
udongo-7.2.1 app/models/content_text.rb