Skip to content

feat: Support encrypted ActionText attributes#1667

Merged
matsales28 merged 1 commit intothoughtbot:mainfrom
spdawson:feat/support-encrypted-action_text-attributes
Aug 8, 2025
Merged

feat: Support encrypted ActionText attributes#1667
matsales28 merged 1 commit intothoughtbot:mainfrom
spdawson:feat/support-encrypted-action_text-attributes

Conversation

@spdawson
Copy link
Copy Markdown
Contributor

@spdawson spdawson commented May 8, 2025

Synopsis

When rich text attributes are declared by passing encrypted: true to has_rich_text, the attribute class will be
ActionText::EncryptedRichText rather than the ActionText::RichText base class.

Extend the existing have_rich_text matcher such that it will continue to match, even when rich text attributes are specified with the encrypted: true option.

Extends work done in #1263.

@spdawson spdawson force-pushed the feat/support-encrypted-action_text-attributes branch 2 times, most recently from ba4d363 to fb0493e Compare May 8, 2025 10:34
@spdawson spdawson marked this pull request as ready for review May 8, 2025 10:35
@spdawson spdawson requested a review from matsales28 as a code owner May 8, 2025 10:35
@matsales28
Copy link
Copy Markdown
Member

Hi @spdawson, just letting you know that I saw your PR and will review it as soon as I can!

Copy link
Copy Markdown
Member

@matsales28 matsales28 left a comment

Choose a reason for hiding this comment

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

There's a failure in the spec. The encrpted_rich_text_is_defined? method is not available inside of the define_model block. @spdawson

When rich text attributes are declared by passing `encrypted: true`
to `has_rich_text`, the attribute class will be
`ActionText::EncryptedRichText` rather than the `ActionText::RichText`
base class.

Extend the existing `have_rich_text` matcher such that it will
continue to match, even when rich text attributes are specified with
the `encrypted: true` option.

Refs: thoughtbot#1263
@spdawson spdawson force-pushed the feat/support-encrypted-action_text-attributes branch from fb0493e to 2ccb661 Compare June 3, 2025 07:10
@matsales28 matsales28 merged commit 8823870 into thoughtbot:main Aug 8, 2025
21 checks passed
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