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

feature: action response to reload records #3372

Merged
merged 2 commits into from
Nov 5, 2024
Merged

Conversation

Paul-Bob
Copy link
Contributor

@Paul-Bob Paul-Bob commented Oct 31, 2024

Description

Fixes #3345

https://www.loom.com/share/6b9ae6a3968c447f98ac4f9a161fe781?sid=7e31f973-09a2-4ea8-a16e-90f379e67f4d

Turbo stream to reload table rows (only for Index view) after running an action.

  def handle(query:, fields:, **args)
    query.each do |record|
      record.update! active: !record.active

      record.notify fields[:message] if fields[:notify_user]
    end

    reload_records(query)
  end

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

@Paul-Bob Paul-Bob self-assigned this Oct 31, 2024
Copy link

codeclimate bot commented Oct 31, 2024

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

View more on Code Climate.

@Paul-Bob Paul-Bob merged commit 5e9b99c into main Nov 5, 2024
22 checks passed
@Paul-Bob Paul-Bob deleted the feature/reload_record branch November 5, 2024 08:46
Copy link
Contributor

github-actions bot commented Nov 5, 2024

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.

Refresh one table row
2 participants