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

Add method ActionCable::Channel#stream_or_reject_for to stream if record is present, otherwise reject the connection #38375

Merged
merged 1 commit into from
Mar 7, 2020

Conversation

Atul9
Copy link
Contributor

@Atul9 Atul9 commented Feb 2, 2020

Summary

closes #38371

As mentioned on issue #38371 ActionCable::Channel#stream_or_reject_for can be use to stream if the record is present otherwise reject the connection.

@rails-bot rails-bot bot added the actioncable label Feb 2, 2020
@Atul9 Atul9 force-pushed the actioncable-stream-or-reject-for branch from 034430f to 3547486 Compare February 4, 2020 17:23
…ord is present, otherwise reject the connection
@Atul9 Atul9 force-pushed the actioncable-stream-or-reject-for branch from 3547486 to 5970429 Compare February 4, 2020 17:25
@Atul9 Atul9 changed the title WIP: Add method ActionCable::Channel#stream_or_reject_for to stream if record is present, otherwise reject the connection Add method ActionCable::Channel#stream_or_reject_for to stream if record is present, otherwise reject the connection Feb 4, 2020
Comment on lines +127 to +130
# Calls stream_for if record is present, otherwise calls reject.
# This method is intended to be called when you're looking
# for a record based on a parameter, if its found it will start
# streaming. If the record is nil then it will reject the connection.
Copy link

@bekicot bekicot Feb 28, 2020

Choose a reason for hiding this comment

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

I think the code is already tell by itself what it does. The comment is no longer needed.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I am ok to remove it when I get another comment from someone from core/committer team(who has access to merge this PR)

Copy link

Choose a reason for hiding this comment

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

That's reasonable.

@Atul9
Copy link
Contributor Author

Atul9 commented Mar 7, 2020

Hi @dhh can you please help to review this PR?

@dhh dhh merged commit ec69083 into rails:master Mar 7, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add ActionCable::Channel.stream_or_reject_for
3 participants