Created
February 26, 2021 05:41
-
-
Save catmando/507449a815765b7160e6fe72e4e7e0c7 to your computer and use it in GitHub Desktop.
Hyperstack vs Hotwire twitter.rb
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Tweet < ApplicationRecord | |
after_create_commit { broadcast_prepend_to "tweets" } | |
after_update_commit { broadcast_replace_to "tweets" } | |
after_destroy_commit { broadcast_remove_to "tweets" } | |
validates :body, presence: true | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment