Revert "Replace House with Lexical"

This commit is contained in:
Jorge Manrubia
2025-05-29 14:22:27 +02:00
committed by GitHub
parent ba54ed6104
commit 08d8b2e5ff
50 changed files with 576 additions and 916 deletions
+1 -1
View File
@@ -9,7 +9,7 @@ class Card < ApplicationRecord
has_many :comments, dependent: :destroy
has_one_attached :image, dependent: :purge_later
has_rich_text :description
has_markdown :description
before_save :set_default_title, if: :published?
+1 -5
View File
@@ -5,7 +5,7 @@ class Comment < ApplicationRecord
belongs_to :creator, class_name: "User", default: -> { Current.user }
has_many :reactions, dependent: :delete_all
has_rich_text :body
has_markdown :body
searchable_by :body_plain_text, using: :comments_search_index, as: :body
scope :chronologically, -> { order created_at: :asc, id: :desc }
@@ -19,10 +19,6 @@ class Comment < ApplicationRecord
end
private
def body_plain_text
body.to_plain_text
end
def watch_card_by_creator
card.watch_by creator
end
+4 -4
View File
@@ -14,7 +14,7 @@ module Mentions
end
def mentionable_content
rich_text_associations.collect { send(it.name)&.to_plain_text }.compact.join(" ")
markdown_associations.collect { send(it.name)&.to_plain_text }.compact.join(" ")
end
private
@@ -32,12 +32,12 @@ module Mentions
collection.users
end
def rich_text_associations
self.class.reflect_on_all_associations(:has_one).filter { it.klass == ActionText::RichText }
def markdown_associations
self.class.reflect_on_all_associations(:has_one).filter { it.klass == ActionText::Markdown }
end
def mentionable_content_changed?
rich_text_associations.any? { send(it.name).body_previously_changed? }
markdown_associations.any? { send(it.name).content_previously_changed? }
end
def create_mentions_later