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

Action cable gf #28

Merged
merged 7 commits into from
May 25, 2022
Merged

Action cable gf #28

merged 7 commits into from
May 25, 2022

Conversation

gregoryjflaherty
Copy link
Contributor

@gregoryjflaherty gregoryjflaherty commented May 25, 2022

Features

  1. Create messages and social table
  2. Create channel for social board
  3. Create new schema
  4. Create new message action
    resolves Create ActionCable channels and Message model for websockets #40

Concerns

  1. Need to make sure we are able to connect the cable server to the FE

Pre-Submittal Checklist

  • All tests pass on local
  • Visually confirm view functionality
  • No prys or save_and_open_page commands remain
  • Unnecessary commented code removed

As a GIF, how does this PR make you feel?

unagi

user_id: user.id
)

SocialChannel.broadcast_to(channel, message)
Copy link
Collaborator

Choose a reason for hiding this comment

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

Great formatting of the broadcasting the desired information.


user = User.find_by(name: params[:name])
channel = Social.first
message = Message.create!(
Copy link
Collaborator

Choose a reason for hiding this comment

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

I like how you broke this down for readability.

@@ -0,0 +1,11 @@
class SocialChannel < ApplicationCable::Channel
def subscribed
Copy link
Collaborator

Choose a reason for hiding this comment

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

Fantastic method in going about the group social channel.

@@ -0,0 +1,5 @@
class AddSocialsToMessages < ActiveRecord::Migration[5.2]
Copy link
Collaborator

Choose a reason for hiding this comment

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

Hopefully this is all we need to get WebSockets live!

@samlsmith424 samlsmith424 merged commit b98a3ba into main May 25, 2022
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.

Create ActionCable channels and Message model for websockets
3 participants