Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: persist values after validation errors on tags fields that acts as taggable on #2868

Merged
merged 4 commits into from
Jun 19, 2024

Conversation

Paul-Bob
Copy link
Contributor

@Paul-Bob Paul-Bob commented Jun 18, 2024

Description

Fixes #2724

Acts as taggable on stores the tags values through DB tables. When the record is not DB persistent (on a new unsaved record) the tags values only can be accessed directly from the record's tag list. tag_list_on(acts_as_taggable_on_option) helper does the trick.

Checklist:

  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • I have added tests that prove my fix is effective or that my feature works

Screenshots & recording

acts_as_taggable_on_fix.webm

@Paul-Bob Paul-Bob added the Fix label Jun 18, 2024
@Paul-Bob Paul-Bob self-assigned this Jun 18, 2024
Copy link

codeclimate bot commented Jun 18, 2024

Code Climate has analyzed commit 59b9d99 and detected 0 issues on this pull request.

View more on Code Climate.

Copy link
Collaborator

@adrianthedev adrianthedev left a comment

Choose a reason for hiding this comment

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

Looks good!

lib/avo/fields/tags_field.rb Outdated Show resolved Hide resolved
lib/avo/fields/tags_field.rb Outdated Show resolved Hide resolved
@Paul-Bob Paul-Bob merged commit 6453b22 into main Jun 19, 2024
27 checks passed
@Paul-Bob Paul-Bob deleted the fix/tags_field_persist_value_after_validation_errors branch June 19, 2024 12:34
Copy link
Contributor

This PR has been merged into main. The functionality will be available in the next release.

Please check the release guide for more information.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Tags Field looses values after a validation error with acts_as_taggable_on
3 participants