instance method
stream_or_reject_for
Ruby on Rails 6.1.7.10
Since v6.1.7.10Signature
stream_or_reject_for(record)
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.
Parameters
-
recordreq
Source
# File actioncable/lib/action_cable/channel/streams.rb, line 131
def stream_or_reject_for(record)
if record
stream_for record
else
reject
end
end
Defined in actioncable/lib/action_cable/channel/streams.rb line 131
· View on GitHub
· Improve this page
· Find usages on GitHub
Defined in ActionCable::Channel::Streams