Skip to content

Add support for ActionText::EncryptedRichText#908

Open
tarellel wants to merge 1 commit intobasecamp:mainfrom
tarellel:main
Open

Add support for ActionText::EncryptedRichText#908
tarellel wants to merge 1 commit intobasecamp:mainfrom
tarellel:main

Conversation

@tarellel
Copy link
Copy Markdown

Summary

Enable usage of ActionText::EncryptedRichText with lexxy. This came up migrating an application I use with encrypted action text content. Its content was displaying only the encrypted values rather than the raw values.

Changed:

  • Added support for ActionText::EncryptedRichText
  • Add note model with has_rich_text :body, encrypted: true
  • Added test to confirm the encryption/decryption of the values

Copilot AI review requested due to automatic review settings March 20, 2026 21:12
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR adds Lexxy support for rendering persisted ActionText::EncryptedRichText content so encrypted Action Text bodies display decrypted HTML instead of ciphertext.

Changes:

  • Teach lexxy_rich_textarea_tag to extract HTML from ActionText::EncryptedRichText.
  • Add a dummy Note model with has_rich_text :body, encrypted: true plus supporting schema/migrations.
  • Add fixtures and a test intended to verify encrypted rich text rendering.

Tip

If you aren't ready for review, convert to a draft PR.
Click "Convert to draft" or run gh pr ready --undo.
Click "Ready for review" or run gh pr ready to reengage.

Reviewed changes

Copilot reviewed 10 out of 10 changed files in this pull request and generated 6 comments.

Show a summary per file
File Description
lib/lexxy/rich_text_area_tag.rb Adds special-case handling for ActionText::EncryptedRichText when extracting HTML for the editor value.
test/helpers/lexxy/tag_helper_test.rb Adds a test intended to validate encrypted rich text rendering (currently not exercising the new code path).
test/fixtures/notes.yml Introduces Note fixtures used by the new encrypted rich text scenario.
test/fixtures/action_text/encrypted_rich_texts.yml Adds encrypted rich text fixtures for the Note record (currently contains a broken fixture reference).
test/dummy/app/models/note.rb Adds dummy model declaring encrypted rich text association.
test/dummy/config/application.rb Configures Active Record encryption keys for the dummy app (primary key string length looks incorrect).
test/dummy/db/migrate/20250517040252_create_action_text_tables.action_text.rb Adds action_text_encrypted_rich_texts table creation to the dummy Action Text migration.
test/dummy/db/migrate/20260320195843_create_notes.rb Creates the notes table in the dummy app.
test/dummy/db/schema.rb Reflects the new dummy tables in schema snapshot.
test/dummy/test/fixtures/notes.yml Adds dummy-app test fixtures for notes.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread test/helpers/lexxy/tag_helper_test.rb Outdated
Comment thread test/dummy/config/application.rb Outdated
Comment thread test/dummy/db/migrate/20250517040252_create_action_text_tables.action_text.rb Outdated
Comment thread test/dummy/db/migrate/20250517040252_create_action_text_tables.action_text.rb Outdated
Comment thread test/helpers/lexxy/tag_helper_test.rb Outdated
Comment thread test/fixtures/action_text/encrypted_rich_texts.yml Outdated
Copilot AI review requested due to automatic review settings March 20, 2026 21:49
@tarellel tarellel force-pushed the main branch 2 times, most recently from 5f8a6d9 to ecd4c23 Compare March 20, 2026 21:55
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 10 out of 10 changed files in this pull request and generated 7 comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread test/helpers/lexxy/tag_helper_test.rb Outdated
Comment thread test/helpers/lexxy/tag_helper_test.rb
Comment thread test/dummy/test/fixtures/notes.yml
Comment thread test/dummy/config/application.rb Outdated
Comment thread test/dummy/db/migrate/20250517040252_create_action_text_tables.action_text.rb Outdated
Comment thread lib/lexxy/rich_text_area_tag.rb Outdated
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 9 out of 9 changed files in this pull request and generated 2 comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread test/dummy/db/migrate/20250517040252_create_action_text_tables.action_text.rb Outdated
Comment thread lib/lexxy/rich_text_area_tag.rb Outdated
@tarellel tarellel changed the title CHANGED: Added support for ActionText::EncryptedRichText Add support for ActionText::EncryptedRichText Mar 23, 2026
Copilot AI review requested due to automatic review settings March 24, 2026 00:09
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 9 out of 9 changed files in this pull request and generated 5 comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread lib/lexxy/rich_text_area_tag.rb
Comment thread test/fixtures/notes.yml Outdated
Comment thread test/dummy/test/fixtures/notes.yml
Comment thread test/dummy/db/migrate/20250517040252_create_action_text_tables.action_text.rb Outdated
Comment thread test/helpers/lexxy/tag_helper_test.rb
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants