-
Notifications
You must be signed in to change notification settings - Fork 583
Spike events system #108
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
Spike events system #108
Conversation
josefarias
commented
Oct 12, 2024

* main: Bump importmap-rails from 2.0.2 to 2.0.3 Bump rails from `f1be11a` to `57fe7e7`
|
|
||
| def boost! | ||
| transaction do | ||
| increment! :boost_count |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should use AR counters: https://api.rubyonrails.org/v7.1/classes/ActiveRecord/CounterCache/ClassMethods.html
| class: "btn btn--plain", | ||
| data: { action: "toggle-class#toggle" }, | ||
| form_class: "full-width" do %> | ||
| + <%= bubble.boost_count if bubble.boost_count.positive? %> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You can lean on the AR counter methods here for a more natural API.